Difference between revisions of "Google Nexus 7 2012 (asus-grouper)"

From postmarketOS
Jump to navigation Jump to search
(update grouper / tilapia according to MR 1025)
 
(18 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
| manufacturer = Google (ASUS)
 
| manufacturer = Google (ASUS)
 
| name = Nexus 7 (2012)
 
| name = Nexus 7 (2012)
| codename = asus-grouper & asus-tilapia
+
| codename = asus-grouper
 
| image = File:Nexus7_grouper_gnome_maps.jpeg
 
| image = File:Nexus7_grouper_gnome_maps.jpeg
 
| imagecaption = Google Nexus 7
 
| imagecaption = Google Nexus 7
 
| releaseyear = 2012
 
| releaseyear = 2012
 
| originalsoftware = Android 4.1.2 on Linux 3.0
 
| originalsoftware = Android 4.1.2 on Linux 3.0
| chipset = Nvidia Tegra 3
+
| chipset = Nvidia Tegra 3 T30
 
| cpu = Quad-core 1.2 GHz Cortex-A9
 
| cpu = Quad-core 1.2 GHz Cortex-A9
 
| gpu = ULP GeForce
 
| gpu = ULP GeForce
Line 14: Line 14:
 
| memory = 1 GB
 
| memory = 1 GB
 
| architecture = armv7
 
| architecture = armv7
 +
| whet_dhry = 1364.3
 
| status_usbnet = Y
 
| status_usbnet = Y
 
| status_flashing = Y
 
| status_flashing = Y
Line 24: Line 25:
 
| status_battery = Y
 
| status_battery = Y
 
| status_3d = P
 
| status_3d = P
| status_accel =  
+
| status_accel = Y
 
| status_audio = Y
 
| status_audio = Y
 
| status_bluetooth = Y
 
| status_bluetooth = Y
 
| status_camera =
 
| status_camera =
| status_gps =  
+
| status_gps = P
 
| status_mobiledata = -
 
| status_mobiledata = -
 
| status_sms = -
 
| status_sms = -
Line 43: Line 44:
 
=== Users owning this device ===
 
=== Users owning this device ===
 
{{Device owners}}
 
{{Device owners}}
 +
 +
== Variants ==
 +
 +
* grouper rev. PM269 - without GSM (oldest)
 +
* grouper rev. E1565 - without GSM (modern revision)
 +
* tilapia rev. E1565 - with GSM
 +
 +
 +
==== Do I have grouper or tilapia? ====
 +
<syntaxhighlight lang="shell" line='line'>
 +
TWRP (adb shell) $ grep androidboot.baseband=unknown /proc/cmdline && echo grouper || echo tilapia
 +
</syntaxhighlight>
 +
 +
==== Which hardware revision of grouper do I have? ====
 +
<syntaxhighlight lang="shell">
 +
TWRP (adb shell) $ find /sys/devices/ | grep -c max776 && echo You have E1565
 +
TWRP (adb shell) $ find /sys/devices/ | grep -c tps6591 && echo You have PM269
 +
</syntaxhighlight>
  
 
== Flashing ==
 
== Flashing ==
Line 52: Line 71:
  
 
=== Installation process ===
 
=== Installation process ===
 +
Preparing rootfs and flashing kernel:
 
<syntaxhighlight lang="shell" line='line'>
 
<syntaxhighlight lang="shell" line='line'>
$ pmbootstrap init # choose asus grouper or asus tilapia
+
$ pmbootstrap init
 
$ pmbootstrap install
 
$ pmbootstrap install
 
$ pmbootstrap flasher flash_kernel
 
$ pmbootstrap flasher flash_kernel
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Special installation process (development setup, kernel over approx. 4M) ===
+
==== Flashing rootfs smaller than 650 MB ====
 
 
If you need bigger kernel, this includes way to the latest mainline kernel with size limited only by BOOT partition or how much device will be able boot it:
 
 
 
<syntaxhighlight lang="shell" line='line'>
 
mkdir ~/code
 
cd ~/code
 
git clone https://gitlab.com/alpine-mobile/pmbootstrap.git
 
cd pmbootstrap
 
alias pmbootstrap=~/code/pmbootstrap/pmbootstrap.py
 
pmbootstrap init
 
# pmbootstrap initfs hook_add debug-shell # not required, only for debugging
 
pmbootstrap export
 
pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool findutils
 
export DEVICE="$(pmbootstrap config device)"
 
export WORK="$(pmbootstrap config work)"
 
export TEMP="$WORK/chroot_native/tmp/mainline/"
 
mkdir -p "$TEMP"
 
 
 
cd ~/code
 
git clone https://github.com/okias/linux.git
 
cd linux
 
source ~/code/pmbootstrap/helpers/envkernel.sh
 
 
 
sudo curl -o .output/.config https://gitlab.com/alpine-mobile/pmaports/raw/master/device/linux-asus-grouper/config-asus-grouper.armv7
 
sudo sed -i "s|CONFIG_INITRAMFS_SOURCE=\"\"|CONFIG_INITRAMFS_SOURCE=\"initfs-extracted\"|" .output/.config
 
pmbootstrap initfs extract # ugly hack to get kernel booting without external initrd
 
sudo cp -r ~/.local/var/pmbootstrap/chroot_rootfs_asus-grouper/tmp/initfs-extracted ./.output/ # initfs is later compiled into kernel
 
 
 
make -j5
 
 
 
cd ~/code/linux/.output/arch/arm/boot
 
cat zImage dts/tegra30-asus-nexus7-grouper.dtb > ~/code/linux/.zImage-dtb # grouper or tilapia
 
cp ~/code/linux/.zImage-dtb "$TEMP"/zImage-dtb
 
 
 
pmbootstrap flasher list_devices
 
</syntaxhighlight>
 
===== a. Boot only =====
 
<syntaxhighlight lang="shell" line='line'>
 
pmbootstrap chroot -- fastboot boot /tmp/mainline/zImage-dtb
 
</syntaxhighlight>
 
===== b. Flash kernel: =====
 
We're still not able bundle classic boot.img, so we need generate boot.img without ramdisk (which is already included inside kernel).
 
<syntaxhighlight lang="shell" line='line'>
 
pmbootstrap chroot -- mkbootimg-osm0sis --kernel "/tmp/mainline/zImage-dtb" --base "0x10000000" --kernel_offset "0x00008000" --ramdisk_offset "0x01000000" --tags_offset "0x00000100" --pagesize "2048" -o "/tmp/mainline/boot.img"
 
pmbootstrap chroot -- fastboot boot /tmp/mainline/boot.img # test if image will boot
 
pmbootstrap chroot -- fastboot flash boot /tmp/mainline/boot.img # flash only tested image
 
</syntaxhighlight>
 
 
 
=== Flashing rootfs ===
 
==== rootfs under 650MB ====
 
 
<syntaxhighlight lang="shell" line='line'>
 
<syntaxhighlight lang="shell" line='line'>
 
pmbootstrap flasher flash_rootfs
 
pmbootstrap flasher flash_rootfs
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==== rootfs over 650MB to USERDATA ====
+
==== Flashing rootfs larger than 650 MB ====
''NOTE: If you plan flash Android, this may change size of your data partition. You can fix it by resizing partition in TWRP before flashing Android.''
+
''NOTE: This may change size of your data partition. You can fix it by resizing partition in TWRP before flashing Android.''
  
 
'''You should proceed very carefully here.'''
 
'''You should proceed very carefully here.'''
 +
 +
When rootfs is larger than 650 MB you can choose to flash it to the system partition or USERDATA partition (which is on Nexus always > 4 GB).
 +
This guide is intended will help you flash rootfs onto USERDATA partition.
  
 
Prerequisites: Official TWRP, at least version 3.3.1-0, binaries are here for [https://dl.twrp.me/grouper/ grouper] or [https://dl.twrp.me/tilapia/ tilapia].
 
Prerequisites: Official TWRP, at least version 3.3.1-0, binaries are here for [https://dl.twrp.me/grouper/ grouper] or [https://dl.twrp.me/tilapia/ tilapia].
  
ensure you already run
+
 
<syntaxhighlight lang="shell" line='line'>
+
First, start TWRP (hold power + volume up) and then continue with these instructions
pmbootstrap export
 
</syntaxhighlight>
 
and then proceed with
 
 
<syntaxhighlight lang="shell" line='line'>
 
<syntaxhighlight lang="shell" line='line'>
# start TWRP
+
(computer) $ pmbootstrap export
 
(computer) $ adb shell
 
(computer) $ adb shell
 
(twrp) $ df # look for the data partition. should be something like /dev/block/mmcblk0p9 or p10 with /data next to it
 
(twrp) $ df # look for the data partition. should be something like /dev/block/mmcblk0p9 or p10 with /data next to it
Line 164: Line 134:
 
|wired, not tested yet. Please update if it'll work for you.
 
|wired, not tested yet. Please update if it'll work for you.
 
|-
 
|-
|  
+
| P
 
|GPS
 
|GPS
|Needs entry in DeviceTree. Not tried yet.
+
|Pangelo works on it. Some progress been done. [https://redmine.replicant.us/projects/replicant/wiki/BCM4751 BCM4751]
 
|-
 
|-
 
| Y
 
| Y
 
|WiFi
 
|WiFi
|Wi-Fi works (best with IWD daemon: apk add iwd; rc-config del wpa_supplicant; rc-config add iwd; and [https://wiki.archlinux.org/index.php/NetworkManager#Using_iwd_as_the_Wi-Fi_backend HOWTO]).  
+
|Wi-Fi works (best with IWD daemon: apk add iwd; rc-update del wpa_supplicant; rc-update add iwd; and [https://wiki.archlinux.org/index.php/NetworkManager#Using_iwd_as_the_Wi-Fi_backend HOWTO]).  
 
|-
 
|-
 
| Y
 
| Y
Line 182: Line 152:
 
| Y
 
| Y
 
| Charger
 
| Charger
|there is driver SMB347 for the charger in upstream kernel, but it doesn't have support for device-tree. Patches for upstreaming: https://github.com/okias/linux/commits/smb3xx-charger
+
| Available since Linux 5.10
 
|-
 
|-
 
| Y
 
| Y
 
|Bluetooth
 
|Bluetooth
|Works well, it has even BT 4.0, also BT 5.0 headphones works.
+
|Works well, it has even BT 4.2, also BT 5.0 headphones works.
 
|-
 
|-
 
| Y
 
| Y
Line 207: Line 177:
 
| Y
 
| Y
 
|Proximity sensor
 
|Proximity sensor
|
+
|(tilapia only) Disabled, but works (boolean state, on/off). Would be nice to have this driver work with [https://01.org/linuxgraphics/gfx-docs/drm/driver-api/iio/index.html IIO framework] (TODO)
 
|-
 
|-
 
| Y
 
| Y
 
|Light sensor
 
|Light sensor
|Driver al3010. Brightness regulation [https://floss.social/@okias/103371284828595026 works], install iio-sensor-proxy . It's slightly [https://gitlab.com/alpine-mobile/pmaports/issues/3 oversensitive].
+
|Driver Dyna-Image AL3010. Brightness regulation [https://floss.social/@okias/103371284828595026 works], install iio-sensor-proxy . It's slightly [https://gitlab.com/alpine-mobile/pmaports/issues/3 oversensitive].
 
|-
 
|-
 
| N
 
| N
Line 223: Line 193:
 
| N
 
| N
 
|Modem
 
|Modem
|Present only on tilapia, no-one plan to work on it for now.  
+
|(tilapia only) contribution welcome, no work done yet.
 
|-
 
|-
 
|}
 
|}
Line 259: Line 229:
 
* {{issue|60|pmbootstrap}}: Use the system and userdata partition on Android with LVM
 
* {{issue|60|pmbootstrap}}: Use the system and userdata partition on Android with LVM
 
* {{issue|1422|pmbootstrap}}: The <code>system</code> partition is too small to hold rootfs images over 650Mb (e.g. Plasma Mobile is about 1.1Gb). Flashing to <code>userdata</code> partition fails.
 
* {{issue|1422|pmbootstrap}}: The <code>system</code> partition is too small to hold rootfs images over 650Mb (e.g. Plasma Mobile is about 1.1Gb). Flashing to <code>userdata</code> partition fails.
* [https://gitlab.com/alpine-mobile/pmaports/tree/master/device Merge stuff from Alpine-Mobile (tegra-stuff) back to postmarketOS.]
 
 
* <span style="color:#777777">{{issue|201|pmaports}}: With legacy kernel, device seems to reboot spontaneously under heavy load. For better experience, please use mainline kernel.</span>
 
* <span style="color:#777777">{{issue|201|pmaports}}: With legacy kernel, device seems to reboot spontaneously under heavy load. For better experience, please use mainline kernel.</span>
 
  
 
== Fun Fact ==
 
== Fun Fact ==

Latest revision as of 10:11, 2 May 2021

Google (ASUS) Nexus 7 (2012)
Google Nexus 7
Google Nexus 7
Manufacturer Google (ASUS)
Name Nexus 7 (2012)
Codename asus-grouper
Released 2012
Category testing
Original software Android 4.1.2 on Linux 3.0
Hardware
Chipset Nvidia Tegra 3 T30
CPU Quad-core 1.2 GHz Cortex-A9
GPU ULP GeForce
Display 800x1280 IPS
Storage 8/16/32 GB
Memory 1 GB
Architecture armv7
Unixbench Whet/Dhry score 1364.3
Features
USB Networking
Works
Flashing
Works
Touchscreen
Works
Display
Works
WiFi
Works
Xwayland
Works
FDE
Mainline
Works
Battery
Works
3D Acceleration
Partial
Accelerometer
Works
Audio
Works
Bluetooth
Works
Camera
GPS
Partial
Mobile data
Unavailable
SMS
Unavailable
Calls
Unavailable
USB OTG


Maintainer(s)

  • okias

Contributors

  • antonok
  • pangelo

Users owning this device

  • 00p513 (Notes: Have new one!)
  • Antonok
  • Blitztide
  • BogdanTheGeek (Notes: E1565 no GSM)
  • Clamor (Notes: Running Unlegacy Android Project Nougat ROM -> tests available)
  • Eloy
  • Gull Code (Notes: OK,daily use with XFCE4)
  • Hilledkinged (Notes: Revived from corrupt bootloader)
  • Isot42 (Notes: OK PM269 version)
  • Maff (Notes: Multiple)
  • Nergzd723 (Notes: emmc dead, bct partition intact, possible to fusee-gelee)
  • Okias (Notes: OK, HW rev.E1565 (asus-tilapia))
  • Pangelo (Notes: original grouper (non-GSM) model)
  • Pojntfx
  • The Arjdroid (Notes: Impressive! Works with phosh & xfce4, but not daily driveable yet. It needs 3D acceleration for smoother UI, & firefox fix crashes. Great for running it as a no display server like a raspberry pi. Running with xfce4 can make it usable as a smart display like a calendar or something.)
  • Unah (Notes: grouper E1565 variant)


Variants

  • grouper rev. PM269 - without GSM (oldest)
  • grouper rev. E1565 - without GSM (modern revision)
  • tilapia rev. E1565 - with GSM


Do I have grouper or tilapia?

1 TWRP (adb shell) $ grep androidboot.baseband=unknown /proc/cmdline && echo grouper || echo tilapia

Which hardware revision of grouper do I have?

TWRP (adb shell) $ find /sys/devices/ | grep -c max776 && echo You have E1565
TWRP (adb shell) $ find /sys/devices/ | grep -c tps6591 && echo You have PM269

Flashing

How to enter flash mode

  • Connect a USB cable
  • Power the device off
  • Hold power + volume down
  • fastboot should work when the green android appears on the screen

Installation process

Preparing rootfs and flashing kernel:

1 $ pmbootstrap init
2 $ pmbootstrap install
3 $ pmbootstrap flasher flash_kernel

Flashing rootfs smaller than 650 MB

1 pmbootstrap flasher flash_rootfs

Flashing rootfs larger than 650 MB

NOTE: This may change size of your data partition. You can fix it by resizing partition in TWRP before flashing Android.

You should proceed very carefully here.

When rootfs is larger than 650 MB you can choose to flash it to the system partition or USERDATA partition (which is on Nexus always > 4 GB). This guide is intended will help you flash rootfs onto USERDATA partition.

Prerequisites: Official TWRP, at least version 3.3.1-0, binaries are here for grouper or tilapia.


First, start TWRP (hold power + volume up) and then continue with these instructions

1 (computer) $ pmbootstrap export
2 (computer) $ adb shell
3 (twrp) $ df # look for the data partition. should be something like /dev/block/mmcblk0p9 or p10 with /data next to it
4 (twrp) $ umount /dev/block/mmcblk0p__ <- fill partition number
5 (twrp) $ umount /dev/block/mmcblk0p__ <- fill partition number # again, it can be mounted as /sdcard and as /data
6 (computer again) $ adb push /tmp/postmarketOS-export/asus-grouper.img /dev/block/mmcblk0p__ <- fill partition number
  • grouper has likely data on /dev/block/mmcblk0p9 but make sure!
  • tilapia has likely data on /dev/block/mmcblk0p10 but make sure!

it's probably because tilapia has additional modem partition. If you're not sure, come to our Matrix channel and ask :)

Hardware status (mainline)

There is multiple hardware revisions, so this status may not apply to all of them. This status apply for tilapia (Bach revision).

Status Hardware Info
Y Booting ... but when is kernel larger than approx 4MB, initfs must be packed directly inside kernel (not into boot.img as usual), otherwise kernel won't boot. With downstream kernel it works.
Y Touchscreen Works.
Y USB Works.
Y SDHCI Works.
Y NFC wired, not tested yet. Please update if it'll work for you.
P GPS Pangelo works on it. Some progress been done. BCM4751
Y WiFi Wi-Fi works (best with IWD daemon: apk add iwd; rc-update del wpa_supplicant; rc-update add iwd; and HOWTO).
Y GPIO keys There is 3 keys on GPIO: Power, Volume up, Volume down.
Y Battery Driver works.
Y Charger Available since Linux 5.10
Y Bluetooth Works well, it has even BT 4.2, also BT 5.0 headphones works.
Y Sound sound also works, but require ALSA UCM configuration (for now you'll need to enable DACs and etc using alsamixer)

alsamixer -c 0 # and enable something like: "Speaker R" "Speaker L" "DAC MIXR INF1" "DAC MIXL INF1" "SPOL MIX DAC R1" "SPOL MIX DAC L1" "Stereo DAC MIXR DAC R1" "Stereo DAC MIXL DAC L1"

Y Temperature sensor temperature sensor works
Y Proximity sensor (tilapia only) Disabled, but works (boolean state, on/off). Would be nice to have this driver work with IIO framework (TODO)
Y Light sensor Driver Dyna-Image AL3010. Brightness regulation works, install iio-sensor-proxy . It's slightly oversensitive.
N Front camera
P 3D support See Nvidia_Tegra_2_(tegra20)#Graphics
N Modem (tilapia only) contribution welcome, no work done yet.

UI options

  • Phosh (mainline only): Purism Librem 5 compositor and GNOME based environment, needs performance optimization, but works.
  • Xfce4 (mainline only): Xfce4 is a GTK-based desktop environment aiming to be fast and lightweight. Needs performance optimization, but works. Follow the guide at https://wiki.postmarketos.org/wiki/XFCE4 for adjustments.
  • Weston (on legacy): Boots on legacy kernel. Touchscreen is working.

Development Notes

Kernel

  • Up-to-date kernel, where tegra development ongoing.
  • Old Android kernels: LineageOS kernel sources Unlegacy kernel sources
  • Ubuntu Nexus 7 Kernel wiki (old, last updated 2012)
  • The default images for android provided by google have the bootloader broken, meaning it can't be flashed. It does not seem to affect the install process of PostMarketOS, but is something to take into account. If you need a working bootloader image version 4.23 can be found [here], or can be 4.18 can be grabbed from the factory images for KitKat

Graphics

  • The touchscreen input device is named elan-touchscreen.
  • (legacy) CONFIG_VT had to be enabled for graphics to work. In menuconfig this is located under Device Drivers -> Character devices -> Virtual terminal.
  • (legacy) /sys/class/graphics/fb0/mode is empty on boot, it must have U:800x1280p-0. This uses the same initfs hook as many other devices. Update: Seems to be correctly set now
  • (legacy) weston with fbdev-backend.so uses pixman-type=3 (PIXMAN_TYPE_ABGR), which now does not require configuration.

Wifi

  • There's a proper firmware subpackage now, wifi device should work out-of-the box.
  • "Desktop" Linux firmware are outdated. Check here for latest one.
  • To connect follow the instructions on this page.
  • (legacy)It is possible to manually get wifi working by manually copying fw_bcmdhd.bin and nvram.txt to their kernel-specified locations and configuring /etc/network/interfaces. At this point, running /etc/init.d/networking restart, gave an error about being unable to get a MAC address. After restarting the device to find that wifi Just Worked™, it was possible to successfully scan for wireless networks and establish a connection to secured wireless APs.

Pending Issues

  • pmbootstrap#60: Use the system and userdata partition on Android with LVM
  • pmbootstrap#1422: The system partition is too small to hold rootfs images over 650Mb (e.g. Plasma Mobile is about 1.1Gb). Flashing to userdata partition fails.
  • pmaports#201: With legacy kernel, device seems to reboot spontaneously under heavy load. For better experience, please use mainline kernel.

Fun Fact

grouper was the first tablet to run postmarketOS!

See also

- dmesg logs from various tegra devices https://paste.sr.ht/%7Eokias