Skip to content

Commit

Permalink
ipq40xx: Add subtarget for Google WiFi (Gale)
Browse files Browse the repository at this point in the history
Google WiFi (codename: Gale) is an IPQ4019-based AP, with 2 Ethernet
ports, 2x2 2.4+5GHz WiFi, 512 MB RAM, 4 GB eMMC, and a USB type C port.
In its stock configuration, it runs a Chromium OS-based system, but you
wouldn't know it, since you can only manage it via a "cloud" +
mobile-app system.

The "v2" label is coded into the bootloader, which prefers the
"google,gale-v2" compatible string. I believe "v1" must have been
pre-release hardware.

Note: this is *not* the Google Nest WiFi, released in 2019.

I include "factory.bin" support, where we generate a GPT-based disk
image with 2 partitions -- a kernel partition (using the custom "Chrome
OS kernel" GUID type) and a root filesystem partition. See below for
flashing instructions.

Sysupgrade is supported via recent emmc_do_upgrade() helper.

This is a subtarget because it enables different features
(FEATURES=boot-part rootfs-part) whose configurations don't make sense
in the "generic" target, and because it builds in a few USB drivers,
which are necessary for installation (installation is performed by
booting from USB storage, and so these drivers cannot be built as
modules, since we need to load modules from USB storage).

Flashing instructions
=====================

Documented here:
https://openwrt.org/inbox/toh/google/google_wifi

Note this requires booting from USB storage.

Features
========

I've tested:

 * Ethernet, both WAN and LAN ports
 * eMMC
 * USB-C (hub, power-delivery, peripherals)
 * LED0 (R/G/B)
 * WiFi (limited testing)
 * SPI flash
 * Serial console: once in developer mode, console can be accessed via
   the USB-C port with SuzyQable, or other similar "Closed Case
   Debugging" tools:
     https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/master/docs/ccd.md#suzyq-suzyqable
 * Sysupgrade

Not tested:

 * TPM

Known not working:

 * Reboot: this requires some additional TrustZone / SCM
   configuration to disable Qualcomm's SDI. I have a proposal upstream,
   and based on IRC chats, this might be acceptable with additional DT
   logic:
     [RFC PATCH] firmware: qcom_scm: disable SDI at boot
     https://lore.kernel.org/linux-arm-msm/20200721080054.2803881-1-computersforpeace@gmail.com/
 * SMP: enabling secondary CPUs doesn't currently work using the stock
   bootloader, as the qcom_scm driver assumes newer features than this
   TrustZone firmware has. I posted notes here:
     [RFC] qcom_scm: IPQ4019 firmware does not support atomic API?
     https://lore.kernel.org/linux-arm-msm/20200913201608.GA3162100@bDebian/
 * There's a single external button, and a few useful internal GPIO
   switches. I haven't hooked them up.

The first two are fixed with subsequent commits.

Additional notes
================

Much of the DTS is pulled from the Chrome OS kernel 3.18 branch, which
the manufacturer image uses.

Note: the manufacturer bootloader knows how to patch in calibration data
via the wifi{0,1} aliases in the DTB, so while these properties aren't
present in the DTS, they are available at runtime:

  # ls -l
/sys/firmware/devicetree/base/soc/wifi@a*/qcom,ath10k-pre-calibration-data
  -r--r--r--    1 root     root         12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a000000/qcom,ath10k-pre-calibration-data
  -r--r--r--    1 root     root         12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a800000/qcom,ath10k-pre-calibration-data

Ethernet MAC addresses are similarly patched in via the ethernet{0,1} aliases.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(updated 901 - x1pro moved in the process)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
  • Loading branch information
computersforpeace authored and chunkeey committed Mar 25, 2022
1 parent 26af098 commit f1c041e
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 4 deletions.
2 changes: 1 addition & 1 deletion target/linux/ipq40xx/Makefile
Expand Up @@ -6,7 +6,7 @@ BOARDNAME:=Qualcomm Atheros IPQ40XX
FEATURES:=squashfs fpu ramdisk nand
CPU_TYPE:=cortex-a7
CPU_SUBTYPE:=neon-vfpv4
SUBTARGETS:=generic mikrotik
SUBTARGETS:=generic chromium mikrotik

KERNEL_PATCHVER:=5.10
KERNEL_TESTING_PATCHVER:=5.10
Expand Down
1 change: 1 addition & 0 deletions target/linux/ipq40xx/base-files/etc/board.d/02_network
Expand Up @@ -46,6 +46,7 @@ ipq40xx_setup_interfaces()
cilab,meshpoint-one|\
edgecore,ecw5211|\
edgecore,oap100|\
google,wifi|\
openmesh,a42|\
openmesh,a62)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
Expand Down
10 changes: 9 additions & 1 deletion target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
Expand Up @@ -152,6 +152,13 @@ platform_do_upgrade() {
compex,wpj419)
nand_do_upgrade "$1"
;;
google,wifi)
export_bootdevice
export_partdevice CI_ROOTDEV 0
CI_KERNPART="kernel"
CI_ROOTPART="rootfs"
emmc_do_upgrade "$1"
;;
linksys,ea6350v3 |\
linksys,ea8300 |\
linksys,mr8300)
Expand Down Expand Up @@ -200,7 +207,8 @@ platform_do_upgrade() {

platform_copy_config() {
case "$(board_name)" in
glinet,gl-b2200)
glinet,gl-b2200 |\
google,wifi)
emmc_copy_config
;;
esac
Expand Down
10 changes: 10 additions & 0 deletions target/linux/ipq40xx/chromium/config-default
@@ -0,0 +1,10 @@
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_SCSI_REQUEST=y
CONFIG_SCSI=y
CONFIG_SG_POOL=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
CONFIG_USB_DWC3_QCOM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y
2 changes: 2 additions & 0 deletions target/linux/ipq40xx/chromium/target.mk
@@ -0,0 +1,2 @@
BOARDNAME:=Google Chromium
FEATURES += emmc boot-part rootfs-part

0 comments on commit f1c041e

Please sign in to comment.