Bhe.. allora mi piace veramente mettermi in situazioni difficili..
Avevo appena messo a punto il vecchio modem Astoria, che sempre su eBay ho trovato una spettacolare Vodafone Station.. e non ho resistito.
Dopo qualche peripezia per colpa delle poste, alla fine il modem è arrivato a casa… Tempo di prendere e misure e le due viti sul fondo sono andate via.. sono riuscito ad aprirlo senza distruggerlo e mi sono collegato alla presa seriale presente al suo interno per la parte propedeutica all’installazione di openWRT: modificare il bootloader.
Come al solito ho seguito le preziosissime istruzioni presenti sul sito
http://foro.seguridadwireless.net/openwrt/(desarrollo)-openwrt-en-astoria-arv7510pw22/
Modificato il bootloader in u-boot dopo aver diviso il bootloader stesso in due sezioni per poterlo installare all’interno delle primo due aree di memoria:
UPLOAD Flash
---------------------------------------
Area Address Length
---------------------------------------
[0] Boot 0xB0000000 128K
[1] Configuration 0xB0020000 384K
[2] None 0xB0080000 128K
[3] Special Area 0xB00A0000 128K
[4] Primary Setting 0xB00C0000 128K
[5] Code Image 0 0xB00E0000 7680K
[6] Code Image 1 0xB0860000 7680K
[7] Boot Params 0xB0FE0000 128K
[8] Flash Image 0xB0000000 16384K
---------------------------------------
Enter area to UPLOAD: 0
Upload area 0. Are you sure? (Y/n) Yes
Starting XModem download...(press Enter to abort)
Starting to write flash ...write length 0x00020000
Start checking: flash area 0 length 131072 ...Done.
Poi senza resettare il modem, la seconda parte:
[DANUBE Boot]:u
UPLOAD Flash
---------------------------------------
Area Address Length
---------------------------------------
[0] Boot 0xB0000000 128K
[1] Configuration 0xB0020000 384K
[2] None 0xB0080000 128K
[3] Special Area 0xB00A0000 128K
[4] Primary Setting 0xB00C0000 128K
[5] Code Image 0 0xB00E0000 7680K
[6] Code Image 1 0xB0860000 7680K
[7] Boot Params 0xB0FE0000 128K
[8] Flash Image 0xB0000000 16384K
---------------------------------------
Enter area to UPLOAD: 1
Upload area 1. Are you sure? (Y/n) Yes
Starting XModem download...(press Enter to abort)
Starting to write flash ...write length 0x0000D680
Start checking: flash area 1 length 54912 ...Done.
A questo punto si può resettare il modem:
ROM VER: 1.0.3
CFG 01
Read EEPROMX
X
U-Boot 2013.10-openwrt4 (Jun 19 2014 - 19:45:31) ARV7510PW22
Board: Arcadyan ARV7510PW22
SoC: Lantiq Danube-S v1.5
CPU: 333.333 MHz
IO: 166.667 MHz
BUS: 83.333 MHz
BOOT: NOR
DRAM: 64 MiB
Flash: 16 MiB
*** Warning - bad CRC, using default environment
Alla fine va in errore, in quanto non esiste il “sistema operativo”. Ora lo installiamo !
Configuriamo i parametri per il trasferimento del file
ARV7510PW22 # setenv ipaddr 192.168.0.50
ARV7510PW22 # setenv serverip 192.168.0.100
ARV7510PW22 # setenv ethaddr 74:31:70:xx:xx:xx
ARV7510PW22 # saveenv
Saving Environment to Flash...
. done
Un-Protected 1 sectors
Erasing Flash...
. done
Erased 1 sectors
Writing to Flash... 10....9....8....7....6....5....4....3....2....1....10....9....8....7....6....5....4....3....2....1....done
. done
Protected 1 sectors
ARV7510PW22 # reset
L’indirizzo mac del modem l’ho preso sull’etichetta sul retro del modem.
U-Boot 2013.10-openwrt4 (Jun 19 2014 - 19:45:31) ARV7510PW22
Board: Arcadyan ARV7510PW22
SoC: Lantiq Danube-S v1.5
CPU: 333.333 MHz
IO: 166.667 MHz
BUS: 83.333 MHz
BOOT: NOR
DRAM: 64 MiB
Flash: 16 MiB
In: serial
Out: serial
Err: serial
Net: ltq-eth
Hit any key to stop autoboot: 2 0
ARV7510PW22 # tftp openwrt.bin
Using ltq-eth device
TFTP from server 192.168.0.100; our IP address is 192.168.0.50
Filename 'openwrt.bin'.
Load address: 0x81000000
Loading: *#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############
1.2 MiB/s
done
Bytes transferred = 4718596 (480004 hex)
ARV7510PW22 # protect off all
Un-Protect Flash Bank # 1
................................................................................................................................ done
ARV7510PW22 # era $kernel_addr +$filesize
..................................... done
Erased 37 sectors
ARV7510PW22 # cp.b $loadaddr $kernel_addr $filesize
Copy to Flash... 10....9....8....7....6....5....4....3....2....1....done
ARV7510PW22 # reset
ROM VER: 1.0.3
CFG 01
Read EEPROMX
X
U-Boot 2013.10-openwrt4 (Jun 19 2014 - 19:45:31) ARV7510PW22
Board: Arcadyan ARV7510PW22
SoC: Lantiq Danube-S v1.5
CPU: 333.333 MHz
IO: 166.667 MHz
BUS: 83.333 MHz
BOOT: NOR
DRAM: 64 MiB
Flash: 16 MiB
In: serial
Out: serial
Err: serial
Net: ltq-eth
Hit any key to stop autoboot: 2 1 0
## Booting kernel from Legacy Image at b0060000 ...
Image Name: MIPS OpenWrt Linux-3.10.49
Created: 2014-10-02 7:14:34 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1446470 Bytes = 1.4 MiB
Load Address: 80002000
Entry Point: 80002000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
[ 0.000000] Linux version 3.10.49 (bb@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42625) ) #5 Wed Oct 1 15:41:21 CEST
Fatto !!
Ma …. il software presente sul sito, ha un problema di (forse) gioventù, i quanto in maniera assolutamente casuale (non ho cercato la root cause del problema) il sistema andava in segmentation fault durante il caricamento di alcuni programmi… Per esempio con la parte audio della suite alsa, andava sempre in errore, provocando la morte del router.
A quel punto ho preso tutto l’utimo trunk di openWRT tramite
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker/
installato e configurato tutto il software di contorno tramite i comandi
./scripts/feeds update -a
./scripts/feeds install -a
ed ho fatto ricompilare tutto, in maniera che, come già detto, all’interno del file di installazione fosse presente tutto il necessario.
Dopo due giorni di compilazione, aver rimosso alcuni pacchetti e dopo aver modificato una patch
/home/angelo/Software/openwrt/barrier_breaker/target/linux/lantiq/patches-3.10/0153-lantiq-VPE-softdog.patch
--- /dev/null
+++ b/arch/mips/include/asm/mach-lantiq/vpe.h
@@ -0,0 +1,44 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) 2005 infineon
+ * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ *
+ */
+#ifndef _IFXMIPS_VPE_H__
+#define _IFXMIPS_VPE_H__
+
+/* For the explanation of the APIs please refer the section "MT APRP Kernel
+ * Programming" in AR9 SW Architecture Specification
+ */
+int32_t vpe1_sw_start(void* sw_start_addr, uint32_t tcmask, uint32_t flags);
+int32_t vpe1_sw_stop(uint32_t flags);
+uint32_t vpe1_get_load_addr (uint32_t flags);
+uint32_t vpe1_get_max_mem (uint32_t flags);
+
+int32_t vpe1_set_boot_param(char *field, char *value, char flags);
+int32_t vpe1_get_boot_param(char *field, char **value, char flags);
+
+/* Watchdog APIs */
+extern unsigned long vpe1_wdog_ctr;
+extern unsigned long vpe1_wdog_timeout;
+
+unsigned long vpe1_sw_wdog_start(unsigned long);
+unsigned long vpe1_sw_wdog_stop(unsigned long);
+
+typedef int (*VPE_SW_WDOG_RESET)(unsigned long wdog_cleared_ok_count);
+int32_t vpe1_sw_wdog_register_reset_handler(VPE_SW_WDOG_RESET reset_fn);
+
+#endif
--- /dev/null
+++ b/arch/mips/lantiq/softdog_vpe.c
@@ -0,0 +1,109 @@
+/*
+** =============================================================================
+** FILE NAME : softdog_vpe.c
+** MODULES : LXDB
+** DATE : 24-03-2008
+** AUTHOR : LXDB Team
+** DESCRIPTION : This header file contains the code for the watchdog
+** implentation on vpe1 side.
+** REFERENCES :
+** COPYRIGHT : Copyright (c) 2008
+** Am Campeon 1-12, 85579 Neubiberg, Germany
+** Any use of this software is subject to the conclusion of a respective
+** License agreement. Without such a License agreement no rights to the
+** software are granted
+**
+** HISTORY :
+** $Date $Author $Comment
+** 24-03-2008 LXDB Initial version
+** ============================================================================
+*/
+
+#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/types.h> +#include <linux/timer.h> +#include <linux/reboot.h> +#include <linux/init.h> +#include <linux/jiffies.h> +
+#include
+
+static unsigned long last_wdog_value;
+static unsigned long vpe1_wdog_cleared;
+
+static unsigned long vpe1_wdog_dead;
+static void watchdog_vpe0_fire(unsigned long); /* Called when vpe0 timer expires */
+static void keep_alive_vpe0(unsigned long);
+VPE_SW_WDOG_RESET reset_local_fn;
+
+
+static struct timer_list watchdog_vpe0_ticktock =
+ TIMER_INITIALIZER(watchdog_vpe0_fire, 0, 0);
+
+static void watchdog_vpe0_fire (unsigned long flags)
+{
+ volatile unsigned long *wdog_ctr_value;
+ wdog_ctr_value = (void*)vpe1_wdog_ctr;
+ if (*wdog_ctr_value == last_wdog_value) { /* VPE1 watchdog expiry handling */
+ vpe1_sw_wdog_stop(flags);
+ vpe1_wdog_dead++;
+ printk(KERN_DEBUG "VPE1 watchdog reset handler called\n");
+ /* Call the reset handler function */
+ reset_local_fn(flags);
+ } else { /* Everything is OK on vpe1 side. Continue. */
+ last_wdog_value = *wdog_ctr_value;
+ vpe1_wdog_cleared++;
+ keep_alive_vpe0(flags);
+ }
+}
+
+int32_t vpe1_sw_wdog_register_reset_handler (VPE_SW_WDOG_RESET reset_fn)
+{
+ reset_local_fn = (VPE_SW_WDOG_RESET)reset_fn;
+ return 0;
+}
+
+static void keep_alive_vpe0(unsigned long flags)
+{
+ mod_timer(&watchdog_vpe0_ticktock, jiffies+ vpe1_wdog_timeout );
+}
+
+unsigned long vpe1_sw_wdog_start(unsigned long flags)
+{
+ volatile unsigned long *wdog_ctr_value;
+ wdog_ctr_value = (void*)vpe1_wdog_ctr;
+ *wdog_ctr_value = 0;
+ last_wdog_value = 0;
+ keep_alive_vpe0(flags);
+ return 0;
+}
+
+unsigned long vpe1_sw_wdog_stop(unsigned long flags)
+{
+ del_timer(&watchdog_vpe0_ticktock);
+ return 0;
+}
+
+static int __init watchdog_vpe1_init(void)
+{
+ /* Nothing to be done here */
+ return 0;
+}
+
+static void __exit watchdog_vpe1_exit(void)
+{
+ unsigned long flags=0;
+ vpe1_sw_wdog_stop(flags);
+}
+
+module_init(watchdog_vpe1_init);
+module_exit(watchdog_vpe1_exit);
+
+EXPORT_SYMBOL(vpe1_sw_wdog_register_reset_handler);
+EXPORT_SYMBOL(vpe1_sw_wdog_start);
+EXPORT_SYMBOL(vpe1_sw_wdog_stop);
+
+MODULE_AUTHOR("LXDB");
+MODULE_DESCRIPTION("Software Watchdog For VPE1");
+MODULE_LICENSE("GPL");
tutto è andato a posto.