aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/patches-4.14
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2019-03-06 20:15:19 +0100
committerChristian Lamparter <chunkeey@gmail.com>2019-03-18 20:43:09 +0100
commitb3a0c97b8c936716360065cbf2309cb4b15b782c (patch)
treecfd4b68a810b5d706115bf9dc19ce0f8738842d9 /target/linux/ath79/patches-4.14
parent8f6f2603029726e62f0fae49c03684472fed2b3d (diff)
downloadupstream-b3a0c97b8c936716360065cbf2309cb4b15b782c.tar.gz
upstream-b3a0c97b8c936716360065cbf2309cb4b15b782c.tar.bz2
upstream-b3a0c97b8c936716360065cbf2309cb4b15b782c.zip
ath79: add support for jjPlus JA76PF2
jjPlus JA76PF2 (marketed as IntellusPro2) is a network embedded board. Specification SoC: Atheros AR7161 RAM: 64 MB DDR Flash: 16 MB SPI NOR Ethernet: 2x 10/100/1000 Mbps AR8316 LAN (CN11), WAN/PoE (CN6 - close to power barrel connector, 48 V) MiniPCI: 2x LEDS: 4x, which 3 are GPIO controlled Buttons: 2x GPIO controlled Reset (SW1, closer to ethernet ports), WPS (SW2) Serial: 1x (only RX and TX are wired) baud: 115200, parity: none, flow control: none Currently there is one caveat compared to ar71xx target images as the MAC addresses are random on every reboot. To remedy this one needs to store the WAN MAC address in RedBoot configuration. OpenWrt on first boot, after flashing, will read out the address and assign proper ones to both WAN and LAN ports. It is iportant to NOT keep the old configuration when doing sysupgrade from ar71xx. Upgrading from OpenWrt ar71xx image 1. Connect to serial port, 2. Download OpenWrt sysupgrade image to /tmp directory and flash it with: sysupgrade -n <openwrt_sysupgrade_image_name> 3. After writing new image OpenWrt will reboot, now interrupt boot process and enter RedBoot (bootloader) command line by pressing Ctrl+C, 4. Enter following commands (replace variable accordingly), set_mac (to view MAC addresses) alias ethaddr <wan_port_mac_adress> (confirm storing the value by inputting y and pressing Enter) reset 5. Now board should restart and boot OpenWrt with proper MAC addresses. Installation 1. Prepare TFTP server with OpenWrt initramfs image, 2. Connect to WAN ethernet port, 3. Connect to serial port, 4. Power on the board and enter RedBoot (bootloader) command line by pressing Ctrl+C, 5. Enter following commands (replace variables accordingly): set_mac (to view MAC addresses) alias ethaddr <wan_port_mac_address> (confirm storing the value by inputting y and pressing Enter) ip_adress -l <board_ip_adress>/24 -h <tftp_server_ip_adress> load -r -b 0x80060000 <openwrt_initramfs_image_name> exec -c "" 6. Now board should boot OpenWrt initramfs image, 7. Download OpenWrt sysupgrade image to /tmp directory and flash it with: sysupgrade <openwrt_sysupgrade_image_name> 8. Wait few minutes, after the D2 LED will stop blinking, the board is ready for configuration. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Diffstat (limited to 'target/linux/ath79/patches-4.14')
-rw-r--r--target/linux/ath79/patches-4.14/408-mtd-redboot_partition_scan.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/ath79/patches-4.14/408-mtd-redboot_partition_scan.patch b/target/linux/ath79/patches-4.14/408-mtd-redboot_partition_scan.patch
new file mode 100644
index 0000000000..cd41e7ceb2
--- /dev/null
+++ b/target/linux/ath79/patches-4.14/408-mtd-redboot_partition_scan.patch
@@ -0,0 +1,44 @@
+--- a/drivers/mtd/redboot.c
++++ b/drivers/mtd/redboot.c
+@@ -76,12 +76,18 @@ static int parse_redboot_partitions(stru
+ static char nullstring[] = "unallocated";
+ #endif
+
++ buf = vmalloc(master->erasesize);
++ if (!buf)
++ return -ENOMEM;
++
++ restart:
+ if ( directory < 0 ) {
+ offset = master->size + directory * master->erasesize;
+ while (mtd_block_isbad(master, offset)) {
+ if (!offset) {
+ nogood:
+ printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n");
++ vfree(buf);
+ return -EIO;
+ }
+ offset -= master->erasesize;
+@@ -94,10 +100,6 @@ static int parse_redboot_partitions(stru
+ goto nogood;
+ }
+ }
+- buf = vmalloc(master->erasesize);
+-
+- if (!buf)
+- return -ENOMEM;
+
+ printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n",
+ master->name, offset);
+@@ -170,6 +172,11 @@ static int parse_redboot_partitions(stru
+ }
+ if (i == numslots) {
+ /* Didn't find it */
++ if (offset + master->erasesize < master->size) {
++ /* not at the end of the flash yet, maybe next block :) */
++ directory++;
++ goto restart;
++ }
+ printk(KERN_NOTICE "No RedBoot partition table detected in %s\n",
+ master->name);
+ ret = 0;