From 2796ab85ed5097d91623e60abf22325bd9086407 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 2 Mar 2018 11:56:53 +0100 Subject: ipq40xx: add support for Compex WPJ428 * QCA IPQ4028 * 256 MB of RAM * 32 MB of SPI NOR flash (mx25l25635e) * 128 MB of SPI NAND flash (gd5f1gq4ucy1g) * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - uses AP-DK03 BDF from QCA4019/hw1.0/board-2.bin * 2T2R 5 GHz - QCA4019 hw1.0 (SoC) - uses AP-DK03 BDF from QCA4019/hw1.0/board-2.bin * 2 fully software controllable GPIO-LEDs * 2 additional GPIO-LEDs which also affect the SIM card detection * 1x button (reset) * 1x GPIO buzzer * 1x USB (xHCI) * 1x NGFF (USB-only with Dual-SIM support, untested) * TTL pins are on board (R124 is next to GND, then follows: RX, TX, VCC) * 2x gigabit ethernet - phy@mdio4: + Manual: Ethernet port 0 + gmac0 (ethaddr) in original firmware + 802.3af POE (HV version) + 24v passive POE (LV version) - phy@mdio3: + Manual: Ethernet port 1 + gmac1 (eth1addr) in original firmware * DC Jack connector + 24-56V (HV version) + 12-24V (LV version) The SPI NAND flash isn't supported at the moment. The bootloader has to be updated before OpenWrt is installed to fix a reboot problem. The nor-ipq40xx-single.img from https://downloads.compex.com.sg/?dir=uploads/QSDK/QCA-Reference/WPJ428/b170123-IPQ40xx-Reference-Firmware has to be downloaded and the transfered in u-boot via TFTP set ipaddr 192.168.1.11 set serverip 192.168.1.10 ping ${serverip} tftpboot 0x84000000 nor-ipq40xx-single.img imgaddr=0x84000000 && source $imgaddr:script The sysupgrade image can be installed directly on flash using u-boot: sf probe tftpboot 0x84000000 openwrt-ipq40xx-compex_wpj428-squashfs-sysupgrade.bin sf erase 0x00180000 +$filesize sf write 0x84000000 0x00180000 $filesize bootipq The initramfs image can be started using tftpboot 0x82000000 openwrt-ipq40xx-compex_wpj428-initramfs-fit-uImage.itb set fdt_high 0x83000000 bootm 0x82000000 The used SIM card slot can be changed using # slot 1 (also enables orange LED) echo 1 > /sys/class/gpio/gpio3/value # slot 2 echo 0 > /sys/class/gpio/gpio3/value It can be checked whether a SIM card is inserted in the current slot and the red LED is subsequently on via: echo 2 > /sys/class/gpio/export cat /sys/class/gpio/gpio2/value Signed-off-by: Sven Eckelmann --- target/linux/ipq40xx/base-files/etc/board.d/02_network | 3 +++ .../ipq40xx/base-files/etc/board.d/03_gpio_switches | 17 +++++++++++++++++ .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 2 ++ 3 files changed, 22 insertions(+) create mode 100755 target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches (limited to 'target/linux/ipq40xx/base-files') diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index d25a039f2d..a53e2860ad 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -27,6 +27,9 @@ avm,fritzbox-4040) ucidef_add_switch "switch0" \ "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" ;; +compex,wpj428) + ucidef_set_interface_lan "eth0 eth1" + ;; glinet,gl-b1300) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 0000000000..4e306a94a5 --- /dev/null +++ b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,17 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +compex,wpj428) + ucidef_add_gpio_switch "sim_card_select" "SIM card select" "3" "0" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 4322c4f3fa..969983e6b9 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -128,6 +128,7 @@ case "$FIRMWARE" in ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 4096 12064 ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) +2) ;; + compex,wpj428 |\ openmesh,a42) ath10kcal_extract "0:ART" 4096 12064 ;; @@ -151,6 +152,7 @@ case "$FIRMWARE" in ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 20480 12064 ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) +3) ;; + compex,wpj428 |\ openmesh,a42) ath10kcal_extract "0:ART" 20480 12064 ;; -- cgit v1.2.3