RE: [PATCH 1/2] ipq40xx: add support for Luma WRTQ-329ACN

2020-08-28 Thread Adrian Schmutzler
Hi,

> + DEVICE_VENDOR := Luma
> + DEVICE_MODEL := Home (WRTQ-329ACN)

If you use WRTQ-329ACN as the primary name for OpenWrt here (as in device 
definition, compatible), I'd also put it first here and have the "Home" in 
brackets.
Apart from that, I'd make DEVICE_VENDOR/DEVICE_MODEL consistent with the DTS, 
so add the "Home" in brackets there, too.
 
> + SOC := qcom-ipq4018
> + DEVICE_DTS := qcom-ipq4018-wrtq-329acn

DEVICE_DTS can be dropped, it should be calculated from SOC and device name.

Best

Adrian 


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] ipq40xx: add support for Luma WRTQ-329ACN

2020-08-28 Thread Tomasz Maciej Nowak
Luma WRTQ-329ACN, also known as Luma Home WiFi, is a dual-band wireless
access point.

Specification
SoC: Qualcomm Atheros IPQ4018
RAM: 256 MB DDR3
Flash: 2 MB SPI NOR
   128 MB SPI NAND
WIFI: 2.4 GHz 2T2R integrated
  5 GHz 2T2R integrated
Ethernet: 2x 10/100/1000 Mbps QCA8075
USB: 1x 2.0
Bluetooth: 1x 4.0 CSR8510 A10, connected to USB bus
LEDS: 16x multicolor LEDs ring, controlled by MSP430G2403 MCU
Buttons: 1x GPIO controlled
EEPROM: 16 Kbit, compatible with AT24C16
UART: row of 4 holes marked on PCB as J19, starting count from the side
  of J19 marking on PCB
  1. GND, 2. RX, 3. TX, 4. 3.3V
  baud: 115200, parity: none, flow control: none

The device supports OTA or USB flash drive updates, unfotunately they
are signed. Until the signing key is known, the UART access is mandatory
for installation. The difficult part is disassembling the casing, there
are a lot of latches holding it together.

Teardown
Prepare three thin, but sturdy, prying tools. Place the device with back
of it facing upwards. Start with the wall having a small notch. Insert
first tool, until You'll feel resistance and keep it there. Repeat the
procedure for neighbouring walls. With applying a pressure, one edge of
the back cover should pop up. Now carefully slide one of the tools to
free the rest of the latches.
There's no need to solder pins to the UART holes, You can use hook clips,
but wiring them outside the casing, will ease debuging and recovery if
problems occur.

Installation
1. Prepare TFTP server with OpenWrt initramfs image.
2. Connect to UART port (don't connect the voltage pin).
3. Connect to LAN port.
4. Power on the device, carefully observe the console output and when
   asked quickly enter the failsafe mode.
5. Invoke 'mount_root'.
6. After the overlayfs is mounted run:
 fw_setenv bootdelay 3
   This will allow to access U-Boot shell.
7. Reboot the device and when prompted to stop autoboot, hit any key.
8. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
 tftpboot 0x8400 
 bootm 0x8400
   and wait till OpenWrt boots.
9. In OpenWrt command line run following commands:
 fw_setenv openwrt "setenv mtdids nand1=spi_nand; setenv mtdparts 
mtdparts=spi_nand:-(ubi); ubi part ubi; ubi read 0x8400 kernel1; bootm 
0x8400"
 fw_setenv bootcmd "run openwrt"
10. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
with:
  sysupgrade -v -n /tmp/
11. After flashing, the access point will reboot to OpenWrt, then it's
ready for configuration.

Reverting to OEM firmware
1. Execute installation guide steps: 1, 2, 3, 7, 8.
2. In OpenWrt command line run following commands:
 ubirmvol /dev/ubi0 -N rootfs_data
 ubirmvol /dev/ubi0 -N ubi_rootfs1
 ubirmvol /dev/ubi0 -N kernel1
 ubimkvol /dev/ubi0 -S 264 -N rootfs_data
 ubimkvol /dev/ubi0 -S 34 -N kernel1
 ubimkvol /dev/ubi0 -S 320 -N ubi_rootfs1
 fw_setenv bootcmd bootipq
3. Reboot.

Known issues
The LEDs ring doesn't have any dedicated driver or application to control
it, the only available option atm is to manipulate it with 'i2cset'
command. The default action after applying power to device is spinning
blue light. This light will stay active at all time. To disable it
install 'i2c-tools' with opkg and run:
 i2cset -y 2 0x48 3 1 0 0 i
The light will stay off until next cold boot.

Additional information
After completing 5. step from installation guide, one can disable asking
for root password on OEM firmware by running:
 sed -e 's/root:x:/root::/' -i /etc/passwd
This could be useful to ivestigate OEM firmware and communication with
producer cloud servers or simply making a backup of both flash chips.
The root password seems to be constant across all sold devices.
This is output of 'led_ctl' from OEM firmware to illustrate
possibilities of LEDs ring:

Usage: led_ctl [status | upgrade | force_upgrade | version]
   led_ctl solidCOLOR 
   led_ctl single   COLOR INDEX 
   led_ctl spinning COLOR 
   led_ctl fill COLOR 
 ( default is 5 )
   led_ctl flashing COLOR   
  (default is  34)  ( default is 34 )
   led_ctl pulsing  COLOR
COLOR: red, green, blue, yellow, purple, cyan, white

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-envtools/files/ipq40xx |   1 +
 .../ipq40xx/base-files/etc/board.d/02_network |   3 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   2 +
 .../base-files/lib/upgrade/platform.sh|   6 +
 .../arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 277 ++
 target/linux/ipq40xx/image/Makefile   |  13 +
 .../901-arm-boot-add-dts-files.patch  |   3 +-
 7 files changed, 303 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts

diff --git a/package/boot/uboot-envtools/files/ipq40xx