User Tools

Site Tools


toh:pirelli:drg_a226m

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Previous revision
toh:pirelli:drg_a226m [2013/01/24 19:11]
toh:pirelli:drg_a226m [2016/05/28 10:41] (current)
sturia [Flash the new firmware via TFTP]
Line 1: Line 1:
 +====== Pirelli FastWeb DRG A226M ======
 +Supported, but without ADSL.
 +  * Attitude Adjustment (12.09): [[http://​downloads.openwrt.org/​attitude_adjustment/​12.09/​brcm63xx/​generic/​openwrt-A226M-cfe-squashfs-cfe.bin|openwrt-A226M-cfe-squashfs-cfe.bin]]
 +  * Trunk: [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx/​openwrt-A226M-cfe-squashfs-cfe.bin|openwrt-A226M-cfe-squashfs-cfe.bin]]
  
 +===== Hardware =====
 +==== Info ====
 +| **[[wp>​Instruction set|Architecture]]:​** ​ | [[wp>​MIPS architecture|MIPS]] ​      |
 +| **Vendor:​** ​                              | [[wp>​Broadcom]] ​                    |
 +| **[[doc:​techref:​Bootloader]]:​** ​          | [[doc:​techref:​bootloader:​CFE|CFE]] ​ |
 +| **Board ID:**                             | DWV-S0 |
 +| **[[doc:​hardware:​soc |System-On-Chip]]:​** | [[http://​www.broadcom.com/​products/​DSL/​xDSL-CPE-Solutions/​BCM6358|BCM6358KFBG ]] |
 +| **[[doc:​hardware:​cpu |CPU]]/​Speed** ​      | BMIPS4350 V1.0 / 300 Mhz [[doc:​hardware:​soc:​soc.broadcom.bcm63xx:​smp|BMIPS Dual Core]] |
 +| **Flash-Chip:​** ​  | :?:                             |
 +| **Flash size:​** ​  | 8 MiB  or 16MiB                         |
 +| **RAM:​** ​         | 32 MiB or 64MiB                         |
 +| **Wireless:​** ​    | 1x miniPCI (no card connected) or Ralink RT2661T miniPCI|
 +| **Ethernet:​** ​    | Broadcom ​ {{:​media:​datasheets:​bcm5325_pinout.png?​linkonly|BCM5325}} w/ vlan support [[doc:​uci:​network#​swconfig]] |
 +| **Internet:​** ​    | ADSL2+ ​          |
 +| **VoIP:​** ​        | 2x FXS ports, [[http://​www.microsemi.com/​products/​voice-line-circuits/​ve880/​le88266 | Le88266 chip]] |
 +| **USB:​** ​         | 1x2.0H + 1x1.1D ​ |
 +| **[[doc:​hardware:​port.serial|Serial]]:​** ​ | [[#​Serial|Yes]] ​ |
 +| **[[doc:​hardware:​port.jtag|JTAG]]:​** ​     | [[#​JTAG|Yes]] ​   |
 +
 +==== Photos ====
 +
 +{{:​media:​pirelli:​a226m_board.jpg?​direct&​600|}}
 +
 +source [[https://​dl.dropbox.com/​u/​16893292/​pirelli_a226m_owrt.jpg]]
 +
 +==== Serial ====
 +The serial port is J10, on the left of the switch chip, [[#​photos|see photos]]
 +
 +|  6  |  GND  |      RX      |  5  |
 +|  4  |  GND  |  Vcc (3.3V) ​ |  3  |
 +|  2  |  GND  |      TX      |  1  |
 +
 +Serial connection parameters are 115200 8N1
 +
 +**NB:** A short circuit between pins ''​RX''​ and ''​TX''​ at power up puts the device in a recovery mode with IP ''​192.168.1.1''​ from where a new firmware can be uploaded. ​ OpenWrt binaries are refused, though, because of invalid CRC.
 +
 +==== JTAG ====
 +Jtag port is J9 near the SoC and the minipci socket, [[#​photos|see photos]]
 +
 +It seems to be a mips e-jtag 14 pin connector with columns swapped (used from the other side?).
 +
 +|  14  | DINT     ​| ​  VREF |  13  |
 +|  12  | SRST_N ​  ​| ​   GND |  11  |
 +|  10  | TCK      |    GND |  9   |
 +|  8   | TMS      |    GND |  7   |
 +|  6   | TDO      |    GND |  5   |
 +|  4   | TDI      |    GND |  3   |
 +|  2   | TRST_N ​  ​| ​   GND |  1   |
 +
 +CPU Chip ID: 00000110001101011000000101111111 (0635817F)
 +
 +I used the JTAG port with [[http://​urjtag.org|urjtag]],​ just use the svn version. Useful info on [[http://​www.neufbox4.org/​wiki/​index.php?​title=Interface_JTAG|"​Neuf Box 4 JTAG" ]]
 +
 +You should probably try the [[http://​openocd.berlios.de/​web/​|Open On-Chip Debugger]]
 +
 +Install OpenWrt on this router :-)
 +
 +===== Requirement to install OpenWRT =====
 +
 +To install OpenWRT you have to stop the system loading through the serial console. ​
 +To do that you need a serial adapter/​converter (that convert TTL +3.3V of router serial console to RS232 (+/-12V) or USB).
 +I suggest to use USB serial converter!! Don't even try to go further without a serial adapter!!
 +
 +You can buy USB serial converter adapter on Ebay (find CP2102 chipset), e.g. [[http://​www.ebay.com/​sch/​i.html?​_from=R40&​_sacat=0&​_nkw=cp2102&​_sop=15|USB serial adapter based on Silicon Labs CP2102 (Ebay)]]
 +
 +===== Backup of the original firmware =====
 +The firmware is based on OpenRG, I don't know how to backup this firmware. **Continue at  your risk!!!**
 +
 +You can try [[doc:​hardware:​soc:​soc.broadcom.bcm63xx#​dump.the.flash|bcm63xx#​dump.the.flash]] It isn't a firmware backup but a whole flash backup --- //danitool 2013/01/23 15:23//
 +
 +===== Restore original firmware =====
 +
 +We need a way to backup it first. =)
 +
 +===== Installing OpenWrt =====
 +
 +You need to setup a tftp server on some host (I can suggest to use dnsmasq for this) to serve the firmware image to the router.
 +
 +Now just download the image for //A226M// from 
 +
 +[[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx|OpenWRT firmware - Broadcom BRCM63xxx CPU]]
 +
 +You have firmwares for two filesystems (squashfs and jffs2)
 +
 +**squashfs** is a filesytem that have system files readonly. more stable and less problems. you cannot destroy importan file
 +
 +**jffs2** is a file system completly writable. more powerfull but you can destroy system files.
 +
 +To start as novice I sugegst to use squasfs firmwares.
 +
 +Skip the jffs2 with 64k erase block as the flash use 128k block, anyway using 64k should not give much problem, just some wasted space and some errors messages. Put the chosen image in the right place (see your tftp server configuration),​ and go to the CFE prompt.
 +
 +  * [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx/​openwrt-A226M-squashfs-cfe.bin|OpenWRT DRGA226M firmware -  CFE squashfs]]
 +  * [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx/​openwrt-A226M-cfe-squashfs-cfe.bin|OpenWRT DRG A226M firmware - squashfs CFE]]
 +  * [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx/​openwrt-A226M-cfe-jffs2-128k-cfe.bin|OpenWRT DRG A226M firmware - jffs2 128K CFE]]
 +  * [[http://​downloads.openwrt.org/​snapshots/​trunk/​brcm63xx/​openwrt-A226M-jffs2-128k-cfe.bin|OpenWRT DRGA226M firmware - CFE jffs2 128K]]
 +
 +==== Poweron the router - Stop the boot process =====
 +
 +Through the serial console and a terminal program (like Hyperterminal,​ Putty portable, Teraterm) setup as 115200, 8 bit data, no parity bit, 1 stop bit, poweron the router and press any key to stop the system loading.
 +
 +==== Flash the new firmware via TFTP =====
 +
 +__I suggest to rename the firmware file downloaded as **firmware.bin**__
 +
 +Now you have to use the //​flashimage//​ command to load the openwrt image, please don't use the //f// command. If you configure (with command //c//) the host ip address you can avoid it in the //​flashimage//​ argument.
 +<​code>​
 +CFE> flashimage
 +
 +     eg. flashimage [hostip:​]compressed_image_file_name
 +or
 +     es: flashimage 192.168.1.100:​firmware.bin
 +or
 +     es: flashimage firmware.bin ​  
 +</​code>​
 +
 +That's all, the device will automatically reboot and openwrt will be there :-)
 +
 +Using dnsmasq:
 +
 +<​code>​
 +dnsmasq -d --enable-tftp --tftp-root=`pwd` -p 0 #fron the directory where firmware is previously downloaded
 +</​code>​
 +where the 192.168.1.100 is your server tftp
 +After the flashing of new firmware the router will reboot.
 +
 +You can use also TFTP server like tftp32. Install tftpd32 and put the firmware file (I suggest to rename it as **firmware.bin**) in the same folder where you installed tftpd32.
 +
 +
 +==== OpenWRT - First boot =====
 +
 +:!: :!: :!: ATM (24 jan 2013) the OPENWRT image is rejected due to wrong CRC in kernel ​ :!: :!: :!:\\
 +FIXME Is this still true today? If this is solved, please update this page accordingly. --- //tmomas 2015/09/30 15:30//\\
 +
 +Boot detail with crc error:
 +<​code>​
 +*** Press any key to stop auto run (1 seconds) ***
 +Auto run second count down: 0
 +Trying to boot from previous MAIN image (0x65dba394) ...
 +Code Address: 0x65DBA394, Entry Address: 0x1970acf7
 +SGP - Flash Kernel Address: 0xBE020100
 +SGP - ulImgCrc : 0xD656A53B  ​
 +SGP - Tag->​kernelLen:​ 0x0011FF00
 +SGP - Flash Kernel Address: 0xBE020100
 +Linux kernel CRC error. ​ Corrupted image?
 +SGP - Tag Kernel crc : 0xD656A53B - calculated: 0x9D91518A ​
 +SGP - Decompression Kernel length: 0x91669AEE pucSrc: 0xBE02010C
 +Trying to boot from previous RECOVERY image (0x80010000) ...
 +Code Address: 0x80010000, Entry Address: 0x80010000
 +SGP - Flash Kernel Address: 0xBE560100
 +SGP - ulImgCrc : 0x80DF5773  ​
 +SGP - Tag->​kernelLen:​ 0x001B008C
 +SGP - Flash Kernel Address: 0xBE560100
 +SGP - Tag Kernel crc : 0x80DF5773 - calculated: 0x80DF5773 ​
 +SGP - Decompression Kernel length: 0x0000001C pucSrc: 0xBE56010C
 +Decompression OK!
 +Entry at 0x80010000
 +</​code>​
 +If you receive this error with the test file: openwrt-A226G-cfe-squashfs-cfe.bin I had also prevents this problem and I solved it with this. (31/​07/​2013)
 +
 +===== Specific OpenWrt configuration =====
 +
 +==== Network configuration ====
 +
 +To have a better match with DRG A226M functions, I suggest you to use it with the following network configuration.
 +Using the interneal editor vi, check and edit **/​etc/​config/​system** file.
 +
 +For more info read [[doc:​hardware:​switch]] config. FIXME To be reviewed
 +
 +<​code>​
 +config interface loopback ​                                                      
 +        option ifname ​  ​lo ​                                                     ​
 +        option proto    static ​                                                 ​
 +        option ipaddr ​  ​127.0.0.1 ​                                              
 +        option netmask ​ 255.0.0.0 ​                                              
 +                                                                                ​
 +config '​switch'​ '​eth1' ​                                                         ​
 +   ​option '​enable' ​     '​1' ​                                                    
 +   ​option '​enable_vlan'​ '​1' ​                                                    
 +   ​option '​reset' ​      '​1' ​                                                    
 +                                                                                ​
 +config '​switch_vlan'​ '​vlan0' ​                                                   ​
 +   ​option '​vlan' ​      '​0' ​                                                     ​
 +   ​option '​device' ​    '​eth1' ​                                                  
 +   ​option '​ports' ​     '0 1 2 5*' ​                                              
 +                                                                                ​
 +config '​switch_vlan'​ '​vlan1' ​                                                   ​
 +   ​option '​vlan' ​      '​1' ​                                                     ​
 +   ​option '​device' ​    '​eth1' ​                                                  
 +   ​option '​ports' ​     '3 5t' ​                                                  
 +                                                                                ​
 +config interface lan                                                            ​
 +        option ifname ​  ​eth1.0 ​
 +        option type     ​bridge ​                                                
 +        option proto    static ​                                                 ​
 +        option ipaddr ​  ​192.168.5.1 ​                                            
 +        option netmask ​ 255.255.255.0 ​                                          
 +        option nat      1                                                       
 +                                                                                ​
 +config '​interface'​ wan 
 +    option '​ifname' ​ '​eth1.1' ​                                                  
 +    option '​proto' ​  '​dhcp'​
 +</​code>​
 +
 +==== Modify the leds config ====
 +
 +To have the led matching DRG A226M features, using the internal editor vi edit the **/​etc/​config/​system** file. Add:
 +
 +<​code>​
 +config '​led'​
 + option '​sysfs'​ '​power:​red'​
 + option '​trigger'​ '​heartbeat'​
 +
 +config '​led'​
 + option name lan
 + option '​sysfs'​ '​usr1:​red'​
 + option trigger netdev
 + option '​dev'​ '​eth1.0'​
 + option mode 'rx tx'
 +
 +config '​led'​
 + option name wan
 + option '​sysfs'​ '​usr2:​red'​
 + option trigger netdev
 + option '​dev'​ '​eth1.1'​
 + option mode 'rx tx'
 +</​code>​
 +
 +
 +==== Web interface (Luci) ====
 +
 +The OpenWRT firmware don't provide by default webui. just telnet interface.
 +To configure the modem through the web interface you should install WebUI (like Luci).
 +To do that you can follow the instructions
 +
 +[[:​doc:​howto:​luci.essentials|OpenWRT - Install WebUI (Luci)]]
 +
 +<​code>​
 +opkg update
 +opkg install luci
 +</​code>​
 +
 +==== Module for mini-pci Wifi Ralink RT2661T ====
 +<​code>​
 +opkg update
 +opkg install kmod-rt61-pci
 +</​code>​
 +
 +Reboot system to activate WiFi.
 +
 +===== Bootlogs =====
 +==== OEM bootlog ====
 +<WRAP bootlog>
 +<​nowiki>​CFE version 1.0.37-8.7 for BCM96358 (32bit,​SP,​BE)
 +Build Date: lun apr  2 10:48:55 CEST 2007 (gpaolo@buildserver)
 +Copyright (C) 2000-2005 Broadcom Corporation.
 +
 +Boot Address 0xbe000000
 +
 +Initializing Arena.
 +Initializing Devices.
 +Parallel flash device: name AM29LV320MT,​ id 0x2201, size 8192KB
 +CPU type 0x2A010: 300MHz, Bus: 133MHz, Ref: 64MHz
 +CPU running TP0
 +Total memory: 33554432 bytes (32MB)
 +
 +Total memory used by CFE:  0x80401000 - 0x80527ED0 (1208016)
 +Initialized Data:          0x8041D940 - 0x8041F700 (7616)
 +BSS Area:                  0x8041F700 - 0x80425ED0 (26576)
 +Local Heap:                0x80425ED0 - 0x80525ED0 (1048576)
 +Stack Area:                0x80525ED0 - 0x80527ED0 (8192)
 +Text (code) segment: ​      ​0x80401000 - 0x8041D938 (117048)
 +Boot area (physical): ​     0x00528000 - 0x00568000
 +Relocation Factor: ​        ​I:​00000000 - D:00000000
 +
 +Resetting Secondary CPU... ​
 +
 +Board IP address ​                 : 192.168.1.1:​ffffff00  ​
 +Host IP address ​                  : 192.168.1.100  ​
 +Gateway IP address ​               :   
 +Run from flash/host (f/h)         : f  ​
 +Default host run file name        : vmlinux  ​
 +Default host flash file name      : bcm963xx_fs_kernel  ​
 +Boot delay (0-9 seconds) ​         : 1  ​
 +Boot image (0=latest, 1=previous) : 0  ​
 +Board Id (0-6)                    : DWV-S0  ​
 +Number of MAC Addresses (1-32) ​   : 13  ​
 +Base MAC Address ​                 : 02:​10:​18:​xxxxxxxxx  ​
 +PSI Size (1-64) KBytes ​           : 24  ​
 +Main Thread Number [0|1]          : 0  ​
 +
 +*** Press any key to stop auto run (1 seconds) ***
 +Auto run second count down: 1
 +web info: Waiting for connection on socket 0.
 +CFE></​nowiki>​
 +</​WRAP>​\\
 +
 +===== VoIP on FXS ports =====
 +A226m has a Le88266 VoIP chip onboard providing 2x FXS ports (= 2x ports you can connect analog phones to in order to make calls leveraging VoIP). This functionality is not natively available in OpenWrt, it requires additional drivers. There is an opensource project, called //​bcm63xx-phone//​ [[https://​github.com/​pgid69/​bcm63xx-phone]],​ providing these drivers, and I managed to compile and make it work on this router in combination with Asterisk, tested on both Attitude Adjustment and Barrier Breaker.
 +The developer of the driver directly tested it on a Huawei box, but it also works on A226M. ​
 +There is no ipk package available at the moment, so you need to compile your own .ipk's package or include them in the image of openwrt. Once you do this, you will be able to connect an analog phone to the FXS ports and leverage it in combination with a cheap VoIP service provider.
 +
 +If you choose to compile the .ipk's and try to install them on a ready-available openwrt image form repository, be aware that opkg might complain about kernel version not being exaclty the same. Just force installation and it should work.
 +I was able to make phone calls originating from an analog phone connected to the A226M and routed to a VoIP provider using SIP signalling and Asterisk as call manager.
 +
 +===== Links =====
 +
 +  * [[http://​www.fastweb.it/​downloads/​PDF/​famiglia/​installazione/​pirelli.pdf|Pirelli A226M - User manual (italian)- PDF]]
 +
 +===== Tags =====
 +[[meta:​tags|How to add tags]]
 +{{tag>​bcm63xx bcm6358 5port serial}}