Project

General

Profile

Upstream » History » Version 218

Denis 'GNUtoo' Carikli, 07/16/2019 02:46 PM

1 12 Denis 'GNUtoo' Carikli
h1. Upstream Linux
2 1 Denis 'GNUtoo' Carikli
3 57 Denis 'GNUtoo' Carikli
{{>toc}}
4
5 100 Denis 'GNUtoo' Carikli
h2. Existing work
6
7
The issue #1882 has some documentation on where the work is being done
8
9 11 Denis 'GNUtoo' Carikli
h2. Benefits of using Upstream Linux
10 2 Denis 'GNUtoo' Carikli
11 11 Denis 'GNUtoo' Carikli
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).
12 2 Denis 'GNUtoo' Carikli
13
Benefits:
14
* 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.
15 46 Denis 'GNUtoo' Carikli
* 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.
16 11 Denis 'GNUtoo' Carikli
* It would enable the support for devices that are or will be added to upstream Linux.
17 2 Denis 'GNUtoo' Carikli
18 22 Denis 'GNUtoo' Carikli
As GNU/Linux expects standard kernel interfaces, this would also enable to run GNU/Linux out of the box on such devices.
19
This has some interesting outcomes:
20 46 Denis 'GNUtoo' Carikli
* 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.
21
* 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.
22 23 Denis 'GNUtoo' Carikli
* 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.
23 22 Denis 'GNUtoo' Carikli
24 2 Denis 'GNUtoo' Carikli
h2. Requirements
25
26 11 Denis 'GNUtoo' Carikli
* For the other standard interfaces (like ASLA, etc) a device running a upstream Linux Kenrel with as few patches as possible is required.
27 2 Denis 'GNUtoo' Carikli
28 4 Denis 'GNUtoo' Carikli
h2. Devices
29
30 5 Denis 'GNUtoo' Carikli
It is best to use a device that requires the least amount of work to be functional under Replicant.
31
More precisely we want to minimize:
32 11 Denis 'GNUtoo' Carikli
* The work needed to have the device usable with upstream Linux.
33 5 Denis 'GNUtoo' Carikli
* The work porting or writing Android hardware abstractions layers.
34
35
To achieve that we can choose a device that:
36
* requires no or very minimal work to be fully supported by Linux.
37
* have less hardware features (so we don't need to support them in Linux and in the HALs).
38
* is easy to buy, so the work can be shared among multiple people.
39 53 Denis 'GNUtoo' Carikli
* doesn't have more freedom flaws than the devices currently supported by Replicant
40 5 Denis 'GNUtoo' Carikli
41 54 Denis 'GNUtoo' Carikli
It is also a good idea to keep one image per device at first, as trying to make a single image that
42 55 Denis 'GNUtoo' Carikli
would work on all ARM device supported by upstream Linux is complicated: Even GNU/Linux
43
distributions have a hard time doing that for ARM devices.
44 6 Denis 'GNUtoo' Carikli
45 58 Denis 'GNUtoo' Carikli
h2. Linux upstream status
46
47 11 Denis 'GNUtoo' Carikli
h3. Smartphones and tablets with a free software bootloader and work in progress upstream Linux support
48 4 Denis 'GNUtoo' Carikli
49 59 Denis 'GNUtoo' Carikli
|_. Formfactor |_. Vendor |_. Product  |_. Linux dts |_. Linux status | Verdict |
50
| Smartphone | LG | Optimus Black | "omap3-sniper.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-sniper.dts | no display(no driver), very few peripherals | Too much work required |
51
| Tablet | Amazon | Kindle Fire (first generation) | "omap4-kc1.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap4-kc1.dts | no display(no driver), very few peripherals | Too much work required |
52 64 Denis 'GNUtoo' Carikli
| Smartphone | | GTA04 A3 | "omap3-gta04a3.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-gta04a3.dts |/3. http://projects.goldelico.com/p/gta04-kernel/page/UpstreamStatus/ |/3. Good fit: Free software bootloader, very few parts not upstream  |
53 60 Denis 'GNUtoo' Carikli
| Smartphone | | GTA04 A4 | "omap3-gta04a4.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-gta04a4.dts |
54
| Smartphone | | GTA04 A5 | "omap3-gta04a5.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-gta04a5.dts |
55 31 Denis 'GNUtoo' Carikli
56 4 Denis 'GNUtoo' Carikli
h3. Replicant supported Samsung Exynos devices
57
58 65 Denis 'GNUtoo' Carikli
|_. Formfactor |_. Vendor |_. Product |_. Linux dts | Linux status page | Issues | Verdict |
59 130 Denis 'GNUtoo' Carikli
| Smartphone | Samsung | Galaxy S (i9000)  | "s5pv210-galaxys.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/s5pv210-galaxys.dts  | https://github.com/PabloPL/linux/wiki (needs verified, but looks right) | * Probably has a signed bootloader, but u-boot mainline was placed in BL2, copying much of the bootloader work done on the i9300 and n7100 https://github.com/xc-racer99/u-boot-galaxys4g/
60 102 Denis 'GNUtoo' Carikli
* Has shared memory between the modem and the processor running Replicant
61 103 Denis 'GNUtoo' Carikli
* Is supported by Replicant 4.2 but not Replicant 6.0 
62 1 Denis 'GNUtoo' Carikli
* Barely meets Android 9 requirements | |
63 115 Denis 'GNUtoo' Carikli
| Smartphone | Samsung | Galaxy S II (i9100)  | "exynos4210-trats.dts?":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4210-trats.dts (devboard or i9100?) | We don't know of anyone working to mainline the kernel, but an older kernel was updated that can run Android Pie https://github.com/rINanDO/android_kernel_samsung_smdk4412 | Probably has a signed bootloader | |
64 152 Denis 'GNUtoo' Carikli
| Smartphone | Samsung | Galaxy S III (i9300) | "exynos4412-i9300.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4412-i9300.dts |/2. https://blog.forkwhiletrue.me/pages/midas-mainline/ + "patch required for Samsung bootloader":https://github.com/fourkbomb/linux/commit/2a6027178ae40c1d3baa965fe21b19cbf09493ce ("reference":http://lkml.iu.edu/hypermail/linux/kernel/1212.1/01610.html) |/2. Bootloader freedom issues:
65 109 Denis 'GNUtoo' Carikli
* The bootrom is setup to enforce signatures. It will load a first stage bootloader called 'BL1', which is signed by Samsung.
66
* The BL1 that was shipped on Exynos4412 smartphones and tablets required that Samsung's proprietary s-boot be run as BL2.
67 110 Denis 'GNUtoo' Carikli
* By using BL1 images that were signed by Samsung, but shipped on other Exynos 4412 devices (like dev boards), we now can now use whatever we want after that.
68
* "u-boot":https://github.com/fourkbomb/u-boot was "ported to run after Samsung proprietary BL1":https://blog.forkwhiletrue.me/posts/u-boot-on-galaxy-s3/ . This allows us to remove TrustZone or impliment a libre version of it. The kernels shipped by Replicant are compiled without CONFIG_ARM_TRUSTZONE, so it can work with u-boot but for some reason the display will not work  | Good fit: Only the modem, touch keys, and small parts are missing upstream but are available as patches on top of it |
69 105 Kurtis Hanna
| Smartphone | Samsung | Galaxy Note 2 (N7100) | "exynos4412-n710x.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4412-n710x.dts | Good fit: the LCD, the modem, touch keys, and small parts are missing but are available as patches on top of it |
70 149 Denis 'GNUtoo' Carikli
| Tablet | Samsung | Galaxy Note 8.0 (N51XX) | | The platform is kona, not midas, but it might be fairly easy to port to mainline since it uses the same SoC, same fuelgauge, same audio, same radio chip, and maybe other parts apart from LCD and touchscreen as the i9300 and n7100| * If the work done on the i9300 and n7100 bootloader was able to be ported to another SoC, as was done with the i9000, it likely will be easy to port mainline u-boot to this device, which has the same SoC.
71
* Soldered battery => Shops might be able to replace it
72
* Need to find a way to get access to the serial port => The special connector might have serial on it  |
73 1 Denis 'GNUtoo' Carikli
74 153 Denis 'GNUtoo' Carikli
h4. [PATCH] ARM: decompressor: Flush tlb before swiching domain 0 to client mode
75
76
Background on that patch:
77
* "v3.4 worked without that patch.":http://lkml.iu.edu/hypermail/linux/kernel/1212.1/02089.html This means that even with the patch, newer kernel could break at any time, which would force us to (1) understand from where problem comes from (2) look where it broke (3) try to find a way to fix it.
78
* It's needed because the proprietary bootloader turns on the MMU.
79
* It's possible to replace part of it by u-boot, avoiding the issue, but it's a tricky operation as the first part of the bootloader is signed, and needs to be replaced by a version that doesn't check the signatures.
80
* The boot order probably makes it difficult to recover the device if something went wrong replacing the bootloader.
81
* There is no procedure yet to get back to the original bootloader
82
83
"A response to the patch":http://lkml.iu.edu/hypermail/linux/kernel/1212.1/02099.html states:
84
<pre>
85
Yes. The MMU is suppose to be turned off by boot-loader before jumping
86
to the kernel. That explains the problem. No need to patch
87
the kernel here.
88
</pre>
89
90 154 Denis 'GNUtoo' Carikli
However it might still be possible to solve that as:
91
* Some arm CPUs require the Linux kernel to turn off the MMU like in "head-xscale.S":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/compressed/head-xscale.S
92
* Support for some specific bootloader do exist, for instance in "head-sharpsl.S":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/compressed/head-sharpsl.S
93 153 Denis 'GNUtoo' Carikli
94 143 Denis 'GNUtoo' Carikli
h3. Replicant supported Texas Instruments OMAP4 devices
95
96
|_. Formfactor |_. Vendor |_. Product |_. Linux dts | Linux status page | Issues | Verdict |
97 144 Denis 'GNUtoo' Carikli
| Smartphone | Samsung | Galaxy Nexus (I9250) | None | * "Status on PostmarketOS wiki":https://wiki.postmarketos.org/wiki/Google_Galaxy_Nexus_GSM_(samsung-maguro)#Mainline_Kernel_Status
98
* "mainline fork":https://github.com/drebrez/linux/commits/samsung-maguro | ? | Need to write a DTS |
99 148 Denis 'GNUtoo' Carikli
| Tablet | Samsung | Galaxy Tab 2 7.0 (P31xx) |/2. None |/2. ? |/2. * Soldered battery => Shops might be able to replace it
100
* Need to find a way to get access to the serial port => The special connector might have serial on it |/2. ? |
101 147 Denis 'GNUtoo' Carikli
| Tablet | Samsung | Galaxy Tab 2 10.1 (P51xx) |
102 143 Denis 'GNUtoo' Carikli
103 27 Denis 'GNUtoo' Carikli
h3. Other devices with some upstream support.
104
105 68 Denis 'GNUtoo' Carikli
|_. Formfactor  |_. Vendor |_. Product |_. Linux dts |_. Linux status page |_. Issues |_. Verdict |
106 82 Denis 'GNUtoo' Carikli
| Tablet | Difrnce | DIT4350 | "sun5i-a13-difrnce-dit4350.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-difrnce-dit4350.dts | | | |
107 83 Denis 'GNUtoo' Carikli
| Tablet | Empire Electronix | D709 tablet | "sun5i-a13-empire-electronix-d709.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts | | | |
108 86 Denis 'GNUtoo' Carikli
| Tablet | Empire Electronix | M712 tablet | "sun5i-a13-empire-electronix-m712.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-empire-electronix-m712.dts | | | |
109 81 Denis 'GNUtoo' Carikli
| Tablet | Gemei | G9 Tablet | "sun4i-a10-gemei-g9.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts | "TODO in the dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts#n66 | | "Missing touchscreen":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts#n71 |
110 108 Denis 'GNUtoo' Carikli
| Smartphone | Samsung | Galaxy SIII 4G (i9305) | "exynos4412-i9305.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4412-i9305.dts | https://blog.forkwhiletrue.me/pages/midas-mainline/ + "patch required for Samsung bootloader":https://github.com/fourkbomb/linux/commit/2a6027178ae40c1d3baa965fe21b19cbf09493ce | Signed bootloader | Good fit:
111 104 Kurtis Hanna
* Not fully supported by Replicant because of its modem but the work can be reused by the Galaxy SIII, Galaxy SII, Note 2, and Note 8.0. 
112 69 Denis 'GNUtoo' Carikli
* touch keys, and small parts are missing upstream but are available as patches on top of it. |
113 73 Denis 'GNUtoo' Carikli
| Smartphone | Nokia | N900 | "omap3-n900.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n900.dts | https://elinux.org/N900 | * Has a signed bootloader
114
* Has only 256M of RAM | Bad fit: not enough RAM |
115 75 Denis 'GNUtoo' Carikli
| Smartphone | Nokia | N9 | "omap3-n9.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n9.dts | https://elinux.org/N9 |/2. * Probably have a signed bootloader
116
* Needs investigation to see if the touchscreen firmware is mandatory |/2. Would need investigation to see if the touchscreen firmware is mandatory |
117
| Smartphone | Nokia | N950 | "omap3-n950.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n950.dts | https://elinux.org/N950 |
118 72 Denis 'GNUtoo' Carikli
| Smartphone | Motorolla | Droid 4 (XT894) | "omap4-droid4-xt894.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap4-droid4-xt894.dts | http://elektranox.org/droid4/ | Probably has a signed bootloader, may have a signed kernel requiring kexec | Bad fit: requires a signed Linux kernel in the boot chain |
119 71 Denis 'GNUtoo' Carikli
| Smartphone | | Nexus 7 (2012) | "qcom-apq8064-asus-nexus7-flo.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dts | |/8. Qualcomm SOC (signed bootloader, unknown modem isolation) |/8. Bad fit:
120
* Would need more guarantees requarding the modem isolation on recent qualcomm SOCs
121
* Would need more research to on the state of free software for more recent qualcom SOCs
122
* Not enough support in the Linux kernel for devices with Qualcomm SOCs |
123 70 Denis 'GNUtoo' Carikli
| | | | "qcom-apq8064-sony-xperia-yuga.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dts |  |
124
| | | | "qcom-msm8974-sony-xperia-amami.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-sony-xperia-amami.dts | |
125 85 Denis 'GNUtoo' Carikli
| Tablet | Sony | Xperia Z2 Tablet | "qcom-msm8974-sony-xperia-castor.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts |  |
126 70 Denis 'GNUtoo' Carikli
| | | | "qcom-msm8974-sony-xperia-honami.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts |  |
127
| Smartphone | | Nexus 5 | "qcom-msm8974-lge-nexus5-hammerhead.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts | |
128
| Smartphone | Samsung | Galaxy S5 | "qcom-msm8974-samsung-klte.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts | |
129 80 Denis 'GNUtoo' Carikli
| | | Fairphone 2 | "qcom-msm8974-fairphone-fp2.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts | |
130 92 Denis 'GNUtoo' Carikli
| Tablet | MSI | Primo81 | "sun6i-a31s-primo81.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun6i-a31s-primo81.dts | | | |
131
| Tablet | Yones TopTech | BS1078 v2 Tablet | "sun6i-a31s-yones-toptech-bs1078-v2.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | | | |
132 88 Denis 'GNUtoo' Carikli
| Tablet | Allwinner? | Q8 A13 Tablet | "sun5i-a13-q8-tablet.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-q8-tablet.dts | | | |
133
| Tablet | Utoo | P66 | "sun5i-a13-utoo-p66.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts | | | |
134 1 Denis 'GNUtoo' Carikli
| Tablet | Primux | INet-98V Rev 02 | "sun5i-a13-inet-98v-rev2.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun5i-a13-inet-98v-rev2.dts | | | |
135 93 Denis 'GNUtoo' Carikli
| Tablet | Primux | INet-86DZ Rev 01 | "sun8i-a23-inet86dz.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a23-inet86dz.dts | | | |
136 90 Denis 'GNUtoo' Carikli
| Tablet | Wondermedia? | WM8650-MID Tablet | "wm8650-mid.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/wm8650-mid.dts | | | |
137 91 Denis 'GNUtoo' Carikli
| Tablet | Wondermedia? | WM8850-W70v2 Tablet | "wm8850-w70v2.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/wm8850-w70v2.dts | | | |
138 89 Denis 'GNUtoo' Carikli
| Tablet | Colorfly | E708 Q1 tablet | "sun6i-a31s-colorfly-e708-q1.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dts | | | |
139 94 Denis 'GNUtoo' Carikli
| Tablet | Polaroid | MID2407PXE03 tablet | "sun8i-a23-polaroid-mid2407pxe03.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts | | | |
140
| Tablet | Polaroid | MID2809PXE04 tablet | "sun8i-a23-polaroid-mid2809pxe04.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts | | | |
141 95 Denis 'GNUtoo' Carikli
| Tablet | Allwinner? | Q8 A23 Tablet | "sun8i-a23-q8-tablet.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts | | | |
142
| Tablet | Allwinner? | Q8 A33 Tablet | "sun8i-a33-q8-tablet.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a33-q8-tablet.dts | | | |
143 96 Denis 'GNUtoo' Carikli
| Tablet | TBS Biometrics | A711 Tablet | "sun8i-a83t-tbs-a711.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | | | |
144 97 Denis 'GNUtoo' Carikli
| Tablet | iNet Tek | iNet Q972 tablet | "sun6i-a31s-inet-q972.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun6i-a31s-inet-q972.dts | | | |
145 98 Denis 'GNUtoo' Carikli
| Tablet | Allwinner? | GT90H Dual Core Tablet (v4) | "sun8i-a23-gt90h-v4.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts | | | |
146
| Tablet | Allwinner? | GA10H Quad Core Tablet (v1.1) | "sun8i-a33-ga10h-v1.1.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts | | | |
147 99 Denis 'GNUtoo' Carikli
| Tablet | Allwinner? | INet-D978 Rev 02 | "sun8i-a33-inet-d978-rev2.dts":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts | | | |
148 27 Denis 'GNUtoo' Carikli
149 1 Denis 'GNUtoo' Carikli
h3. Allwinner devices
150 13 Denis 'GNUtoo' Carikli
151
Devices with Allwinner SOCs are an interesting targets because:
152
* Many of them do not use signed bootloaders.
153
* Many of the SOCs and various devices using them have good Linux and u-boot mainline support
154
155
For instance the Lime 2 from Olimex is pretty well supported and is easy to find.
156
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.
157
158
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.
159
160
A good tablet for this task should have:
161
* A SOC that has good mainline support, see "the Linux mainlining effort page on linux-sunxi":https://linux-sunxi.org/Linux_mainlining_effort for more details.
162
* A Free software bootloader, or the ability to easily add support for the tablet to a free software bootloader.
163
* The ability to power and use an USB WiFi card or chip that is compatible with the ath9k_htc driver.
164
165
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.
166 1 Denis 'GNUtoo' Carikli
167 78 Denis 'GNUtoo' Carikli
h3. Rockchip devices
168
169 79 Denis 'GNUtoo' Carikli
* There is a "Linux upstream status page":http://opensource.rock-chips.com/wiki_Status_Matrix#Mainline%20Kernel%20Status%20Matrix in the "opensource.rock-chips wiki":http://opensource.rock-chips.com
170
* There is also "some information on u-boot":http://opensource.rock-chips.com/wiki_U-Boot in the "opensource.rock-chips wiki":http://opensource.rock-chips.com/
171
172 113 Kurtis Hanna
|_. Formfactor  |_. Vendor |_. Product |_. Linux dts |_. Linux status page |_. Issues |_. Verdict |
173 114 Kurtis Hanna
| Tablet | Acer | Chromebook Tab 10 D651N-K9WT | "rk3399-gru-scarlet.dtsi":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi | | "device specs":https://www.acer.com/ac/en/US/content/model/NX.H0BAA.001 Not many android devices use Coreboot as their bootloader, like this device has, but we likely can use Google's Depthcharge payload in Coreboot to boot into Android. Google "did this":https://www.chromestory.com/2016/01/pixel-c-uses-a-chrome-os-boot-image-not-android/ with the Pixel C. "coreboot support for this board":https://review.coreboot.org/cgit/coreboot.git/tree/src/mainboard/google/gru/devicetree.scarlet.cb "android specific code in depthcharge":https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/master/src/boot/android_dt.c | |
174 78 Denis 'GNUtoo' Carikli
175 134 Denis 'GNUtoo' Carikli
h1. Bootloaders
176 131 Denis 'GNUtoo' Carikli
177 122 Denis 'GNUtoo' Carikli
h2. Bootloader status
178 121 Denis 'GNUtoo' Carikli
179 124 Denis 'GNUtoo' Carikli
|_. Formfactor |_. Vendor |_. Product  |_. signatures |_. Source code |_. status |_. Verdict |
180 179 Denis 'GNUtoo' Carikli
|/6. Smartphone |/6. Samsung | Galaxy S 2 (I9100) | Signed, see "emulating-exynos-4210-bootrom-in-qemu.html":https://fredericb.info/2018/03/emulating-exynos-4210-bootrom-in-qemu.html | ? | ? | ? |
181
| Galaxy SIII (I9300) |/5. the first part is signed |/4. "downstream u-boot for the second part":https://blog.forkwhiletrue.me/posts/an-almost-fully-libre-galaxy-s3/ |/4. |/4. |
182 178 Denis 'GNUtoo' Carikli
| Galaxy SIII 4G (I9305) |
183 133 Denis 'GNUtoo' Carikli
| Galaxy Note 2 (N7100) |
184 174 Denis 'GNUtoo' Carikli
| Galaxy Note 2 4G (N7105) |
185 137 Denis 'GNUtoo' Carikli
| Galaxy Nexus (I9250) | "downstream u-boot for the second part":http://ksyslabs.org/ukernels/gnex_uboot/ | | |
186 138 Denis 'GNUtoo' Carikli
| Smartphone | LG | Optimus Black |/5. unsigned | "upstream u-boot":https://git.denx.de/?p=u-boot.git;a=blob;f=configs/sniper_defconfig | no display(no driver), very few peripherals but enough to be usable | |
187
| Tablet | Amazon | Kindle Fire (first generation) | "upstream u-boot":https://git.denx.de/?p=u-boot.git;a=blob;f=configs/kc1_defconfig | | |
188 139 Denis 'GNUtoo' Carikli
|/3. Smartphone |/3. | GTA04 A3 |/3. "downstream u-boot and xloader":http://projects.goldelico.com/p/gta04-uboot/  |/3. |/3. |
189 137 Denis 'GNUtoo' Carikli
| GTA04 A4 |
190
| GTA04 A5 |
191 121 Denis 'GNUtoo' Carikli
192 1 Denis 'GNUtoo' Carikli
h2. See also
193
194
* [[Google Summer of Code 2018]]
195 12 Denis 'GNUtoo' Carikli
196 140 Kurtis Hanna
h1. Upstream GNU/Linux
197 19 Denis 'GNUtoo' Carikli
198 182 Denis 'GNUtoo' Carikli
h2. Modem support
199 1 Denis 'GNUtoo' Carikli
200 183 Denis 'GNUtoo' Carikli
|_. Protocols |_. Implmentation |_. comments |
201 190 Denis 'GNUtoo' Carikli
| QMI | Android <-> RIL <-> libqmi-ril to be completed <-> libqmi | |
202 184 Denis 'GNUtoo' Carikli
|/2. * QMI
203 1 Denis 'GNUtoo' Carikli
* AT
204 190 Denis 'GNUtoo' Carikli
* Other | Android <-> RIL <-> libraries to be written | 
205 184 Denis 'GNUtoo' Carikli
| RIL + "android_frameworks_opt_telephony_ril_ofono":https://github.com/scintill/android_frameworks_opt_telephony_ril_ofono | Using ofono would enable us to share more effort with upstream GNU/Linux and support many other protocol like AT for the GTA04 or qmi-ril for the Galaxy SIII 4G (I9305) or the Galaxy Note II 4G (N7105) |
206 198 Denis 'GNUtoo' Carikli
|/5. samsung-ipc | Ofono (rilmodem backend/driver) <-> rild <-> libsamsung-ril <-> libsamsung-ipc | * Might be usable for GNU/Linux distributions with "libhybris":https://en.wikipedia.org/wiki/Hybris_%28software%29
207 197 Denis 'GNUtoo' Carikli
* Could be usable for testing Replicant as ofono could run on the host computer and the rild socket could be exported with adb
208
* Some forks exist: check if they still have interesting patches
209
** https://github.com/rilmodem/ofono|
210
| Android <-> rild <-> libsamsung-ril <-> libsamsung-ipc | * Currently in use in Replicant |
211 189 Denis 'GNUtoo' Carikli
| Android <-> Ofono <-> libsamsung-ipc | * "An ofono fork with libsamsung-ipc support is available":https://github.com/fourkbomb/ofono
212 195 Denis 'GNUtoo' Carikli
"Patches":https://lists.ofono.org/pipermail/ofono/2012-September/013777.html to add that upstream were "refused":https://lists.ofono.org/pipermail/ofono/2012-September/013778.html because upstream didn't want to make the project become GPLv3 (libsamsung-ipc was GPLv3 at the time) but now libsamsung-ipc has been relicensed to GPLv2+ |
213 185 Denis 'GNUtoo' Carikli
|
214 197 Denis 'GNUtoo' Carikli
| FSO <-> libsamsung-ipc | * Probably not easily usable in Replicant
215 194 Denis 'GNUtoo' Carikli
* Is FSO still actively maintained?
216 193 Denis 'GNUtoo' Carikli
* Was used by SHR and potentially other GNU/Linux distributions supporting the Openmoko GTA04 smartphones |
217 182 Denis 'GNUtoo' Carikli
218
h2. Upstream userspace hardware support libraries
219
220
|_. Usage |_. Replicant |_. GNU/Linux |_. comments |
221
| Bluetooth stack | BlueDroid | Bluez | |
222
| GPS hardware support | ? | gpsd | |
223
224 16 Denis 'GNUtoo' Carikli
225 20 Denis 'GNUtoo' Carikli
h2. Upstream non-hardware specific userspace
226 18 Denis 'GNUtoo' Carikli
227
|_. Usage |_. Replicant |_. GNU/Linux |_. comments |
228 151 Denis 'GNUtoo' Carikli
| Unix command line tools | ? | * Busybox
229
* Coreutils | * Busybox already has Android specific code in it but no Android.mk 
230
* Busybox build is very similar to Linux, and Linux can be built by Android |
231 44 Denis 'GNUtoo' Carikli
232
h2. Other projects interested in using upstream Linux and/or contributing to it
233
234
* "Postmarketos":https://wiki.postmarketos.org/wiki/The_Mainline_Kernel
235 116 Denis 'GNUtoo' Carikli
236 150 Denis 'GNUtoo' Carikli
h1. Upstream Android
237 1 Denis 'GNUtoo' Carikli
238 150 Denis 'GNUtoo' Carikli
h2. LineageOS
239 141 Denis 'GNUtoo' Carikli
240 117 Denis 'GNUtoo' Carikli
* See "device-support-requirements.md":https://github.com/LineageOS/charter/blob/master/device-support-requirements.md for more information on LineageOS expectations.
241 120 Denis 'GNUtoo' Carikli
242
The devices "initially supported by LineageOS 16":https://lineageos.org/Changelog-22/ have either:
243
* Qualcomm SOCs
244
* An 'HiSilicon Kirin 970" SOCs for the "Huawei Honor View 10":https://wiki.lineageos.org/devices/berkeley or the "Huawei P20 Pro":https://wiki.lineageos.org/devices/charlotte
245
246 1 Denis 'GNUtoo' Carikli
It may be because they rely on nonfree software to support devices, which has not been ported to Android 9, or may be because they need more time to add devices with other SOCs like exynos.
247 141 Denis 'GNUtoo' Carikli
248 150 Denis 'GNUtoo' Carikli
h2. AOSP and LineageOS
249 141 Denis 'GNUtoo' Carikli
250
| Feature | AOSP | LineageOS |
251
| Code quality | Better than LineageOS | |
252 142 Denis 'GNUtoo' Carikli
| Documentation | Better than LineageOS | |
253 141 Denis 'GNUtoo' Carikli
| root | Not sure if supported or not | Supported |
254 200 Denis 'GNUtoo' Carikli
| Minor release versioning | supported with Git tags | Not supported.
255 202 Denis 'GNUtoo' Carikli
For instance frameworks/native has no LineageOS tags (only cm-1x tags) and has no other branch for lineage OS 16.0 than the lineage-16.0 branch, as the other branches name are for other things. This was confirmed after running 'git fetch github' in frameworks/native to fetch the other branches that are not fetched by repo by default.
256 200 Denis 'GNUtoo' Carikli
Despite that, some code was even merged in after the lineage-16.0 release:
257
<pre>
258
commit 22abc3cf4077644463a2dc1c59a5a74e9518ea16
259
Merge: 9e96d54 8a6b6c3
260
Date:   Sat Jul 13 18:57:45 2019 +0200
261
262
    Merge remote-tracking branch 'aosp/pie-gsi' into lineage-16.0-pie-gsi
263
</pre> |
264 141 Denis 'GNUtoo' Carikli
| GUI features for developers
265
* Advanced reboot | ? | Supported |
266 155 Denis 'GNUtoo' Carikli
267
h2. Design decisions
268
269 210 Denis 'GNUtoo' Carikli
Some decisions have been taken by upstream project, for instance the the Android Open Source Project (AOSP) is pushing device manufacturers to use "signed bootloaders":https://source.android.com/security/verifiedboot
270
/device-state#root-of-trust and not give the users the ability to replace that bootloaders. Therefor it is best to revisit such decisions and decide whether to implement or not a given feature.
271 1 Denis 'GNUtoo' Carikli
272 210 Denis 'GNUtoo' Carikli
h3. Various
273
274 1 Denis 'GNUtoo' Carikli
| Feature | Advantages | Disadvantages |
275
| adb and root at boot | Easier to debug:
276
* We get the logs at boot
277
* May be able to diagnose non-booting devices (partition not mountable, etc) | Way less secure:
278
* Vulnerable to "Juice_Jacking":https://en.wikipedia.org/wiki/
279
* Vulnerable to an attacker that just connect an usb cable to a running phone
280
* Breaks the user's expectation of security (lock screen etc) |
281 210 Denis 'GNUtoo' Carikli
282
h3. root filesystem related
283
284
|_. Feature |_. Advantages |_. Disadvantages |_. sustainability |
285
| System as root | * The kernel size can be bigger
286
* You have to hardcode the root partition in the cmdline or use PARTLABEL which might be a security issue: if a microSD has a partition named SYSTEM, the kernel may boot on it instead | having an initramfs adds some flexibility:
287
* Selecting partitions can potentially be more  flexible | |
288
| System as root + dm-verity + "dm-init":https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/device-mapper/dm-init.txt | * The kernel size can be bigger
289
* The partition selection is flexible and secure  | | |
290
| read-only /system | * more secure and more easily understandable by users and developers | * need to ship in replicant user-scripts or add them to vendor/ | |
291 160 Denis 'GNUtoo' Carikli
292
h3. Gatekeeper HAL backend
293
294 209 Denis 'GNUtoo' Carikli
*Background information*: Gatekeeper is a daemon that is used to store passwords and other secrets.
295
296 1 Denis 'GNUtoo' Carikli
| Backend used | Advantages | Disadvantages |
297 161 Denis 'GNUtoo' Carikli
| simple userspace implementation | * Fast to do
298 213 Denis 'GNUtoo' Carikli
* Simple to understand 
299
* Good enough for most use cases| |
300 164 Denis 'GNUtoo' Carikli
| kernel keyring (man 7 keyrings) | * Secure
301 163 Denis 'GNUtoo' Carikli
* The Linux kernel is well known and updated regularily
302 215 Denis 'GNUtoo' Carikli
* Some users are already used to the userspace/kernel security model
303
* Probably fun to implement, can learn how t implement Android daemons and how to use the keyring along the way |
304 1 Denis 'GNUtoo' Carikli
| Free software Trusted Execution Environment (TEE) | * Android does it | * Require access to TrustZone, which doesn't work for all SOCs
305 212 Denis 'GNUtoo' Carikli
* Unfamiliar to users and developers (it's supposed to tick in suspend, knowledge aobut TrustZone is less spread than Linux, etc)
306 214 Denis 'GNUtoo' Carikli
* Probably requires to port a TrustZone OS to every SOC or phone 
307 215 Denis 'GNUtoo' Carikli
* The Linux kernel is well known and updated regularily |
308 165 Denis 'GNUtoo' Carikli
| Proprietary software Trusted Execution Environment (TEE) | None: we really want to get rid of it if possible | 
309 160 Denis 'GNUtoo' Carikli
Cannot be trusted:
310
* Not free software
311
* Not under the user control |
312 203 Denis 'GNUtoo' Carikli
313
h3. Handling dynamic major/minor /dev/ nodes
314
315 208 Denis 'GNUtoo' Carikli
*Background information*: some Linux drivers create dyamic major/minor dev nodes. This is for instance the case with some of the samsung modem drivers that are being worked on to be integrated upstream.
316 207 Denis 'GNUtoo' Carikli
317 203 Denis 'GNUtoo' Carikli
| Backend used | Advantages | Disadvantages | sustainability |
318 205 Denis 'GNUtoo' Carikli
| Android default + Upstream Linux | | * does not work by default, probably impossible to make it work as-is |
319 204 Denis 'GNUtoo' Carikli
| Android default + Upstream Linux + very dirty userspace scripts | * Minimal changes | * Not robust
320
* Might eat up resources
321
* Already implemented cleanly in mdev | |
322
| Android default + hacked drivers to use fixed major/minor | * Minimal changes in Linux
323
* No changes required on Android side | * Require to change userspace software (libsamsung-ipc) | * Not upstreamable in Linux |
324 211 Denis 'GNUtoo' Carikli
| devtmpfs + hacked Andrdroid init | * Minimal changes if upstreamed
325 218 Denis 'GNUtoo' Carikli
* A crude version is being worked on in the modem-i9300 branch of Replicant 9 | * Complex to do as debugging at this stage is complicated | * Need to be usptreamed in Android |
326 203 Denis 'GNUtoo' Carikli
| Stock Andrdroid init + mdev (busybox) | * Bad integration in the Android build system | * Changes are minimal | * Android build system integration need to be upstreamed or maintained |