If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:ADAM2

From BoxMatrix


BoxMatrix >> Lexicon >> FRITZ-Terms >> ADAM2 @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

Computer FRITZ I18N Telephony Smarthome Internet Protocols Multimedia Formats Hardware Software Research

Term

Goto:   FRITZ!OS   -   Versions  -  Features  -  Environment  -  Compression  -  Weblinks  -  SMW-Browser

Details

ADAM2 is a proprietary Bootloader developed by Texas Instruments. It was only used for their AR7 SoCs.

ADAM2 was used in AR7 routers from many Companies, since it was part of the AR7 SDK by TI.
Each company adapted it to their needs. There were some leaks, but the source was never officially released.

FRITZ!OS

This article covers the original ADAM2, for the successor see the EVA article.

AVM used an adapted version of ADAM2 on all their early Kernel 2.4 based models up to 7170v1.
With the introduction of Kernel 2.6 they replaced it with the backward compatible EVA, which AVM developed from scratch.

ADAM2 always allocates the first 64 kB partition of the Flash, located at 0x90000000 - 0x90010000, see mtd2 (bootenv).
This partition always starts with the MIPS initialisation code, which is mandatory to be executed first after reset.
This code could be used as a signature, to locate MIPS based ADAM2 or EVA images in binaries like the Recovery.exe.

Versions

Excerpt from the FRITZ!Box SL boot log captured by the Serial-Console:

ADAM2 Revision TI:0.18.01 AVM:$ProjectRevision: 1.20 $
(C) Copyright 1996-2003 Texas Instruments Inc. All Rights Reserved.
(C) Copyright 2003 Telogy Networks, Inc.
(C) Copyright 2003 AVM

ADAM2 used by AVM is always derived from the 0.18.01 version, which is stored in the bootloaderVersion variable.
This means Texas Instruments version 0.18, Telogy Networks version 01.
The minor part of the AVM ProjectRevision is stored in the urlader-version variable.

From the Shell:

# grep -e bootloader -e urlader -e prompt /proc/avalanche/env

bootloaderVersion    0.18.01
prompt               AVM_Ar7
urlader-version      20

The values of these 3 variables differ for EVA.

Features

Tasks and components of ADAM2:

  • Initialisation of the MIPS CPU (avreset.S)
  • Initialisation of the PLL and clock generators (avalanche.S, ar7.c)
  • Configuration of the EMIF memory interface (avalanche.S)
  • Detection of the SDRAM chip and size (avalanche.S)
  • Configuration of the SDRAM controller (refresh, latency, banks - avalanche.S)
  • Installation of the CPU Exception handler (exception.c)
  • Memory Management System (alloc, free, etc - mms.c)
  • Formatted text output (printf.c)
  • Initialisation and handling of the Bootloader-Environment (init_env.S, env.c)
  • Flash driver (flashop_*.c)
  • EMAC and MDIO Ethernet PHY drivers (emacphy.c)
  • CPMAC network driver (cpmac.c)
  • UART serial drivers (sio.c)
  • ICMP ping (tinyicmp.c)
  • TinyTCP - minimalistic TCP stack (arp.c, sed.c, sed_ar7.c, tinytcp.c, tinyip.c)
  • TinyFTP - minimalistic FTP server (tinyftp.c)
  • ADAM2-Shell - minimalistic Shell (shell.c)

AVM specific extensions:

Options by TI which were not used by AVM:

  • UDP support (tinyudp.c)
  • TFTP server (tftp.c)
  • DHCP client (tinydhcp.c, options.c)
  • WLAN support (wlan.c)
  • S-Record loader (srloader.c)
  • Flash filesystem (ffs.c, ffs_util.c, fcb.c, files.c)

Environment

The initial ADAM2 by TI reserved a 10 kB (10240 bytes) portion of the Bootloader for the Environment, splitting the space into
80 variables with a maximum size of 128 bytes each. This has many disadvantages, like the need of write access to the
bootloader partition, with the risk of data loss and aging or even bricking the entire device.
See CONFIG_MIPS_AVALANCHE_ADAM2_JMP_TBL.

AVM decided to develop something more reliable, which does not touch the bootloader partition. The result was the TFFS
filesystem, which stores both, the Bootloader-Environment and the TFFS-Configuration.

The TFFS uses 2 partitions of the same size, directly following the bootloader partition, each using between 32 kB (fbsl) and
256 kB (7170v1). See mtd3 (bootenv) and mtd4 (bootenv). TFFS is transaction safe, which means there's always a sane copy
of a file, even if electricity breaks down during write. Besides this it does wear leveling, which reduces aging of the Flash.

If the TFFS is empty at boot time builtin defaults for the Bootloader-Environment are preloaded.
Example from urlader.Fritz_Box_2MB.97.adam2.image which is part of the fritz.box_sl.10.03.94.image:

Hardcoded:

reserved              00:04:0E:FF:FF:00
maca                  00:04:0E:FF:FF:01
macb                  00:04:0E:FF:FF:02
macwlan               00:04:0E:FF:FF:03
macdsl                00:04:0E:FF:FF:04
usb_board_mac         00:04:0E:FF:FF:05
usb_rndis_mac         00:04:0E:FF:FF:06
bluetooth             00:04:0E:FF:FF:07
prompt                Adam2_AVM
HWRevision            F
SerialNumber          0000000000000000
my_ipaddress          192.168.178.1
ProductID             Fritz_Box_2MB
usb_device_id         0x3701
usb_revision_id       0x0100
usb_device_name       USB DSL Device
usb_manufacturer_name AVM
annex                 B
autoload              yes

Partially computed:

cpufrequency          150000000 (computed, %d)
memsize               0x00800000 (computed, 0x%08x)
flashsize             0x00200000 (computed, 0x%08x)
modetty0              38400,n,8,1,hw
modetty1              38400,n,8,1,hw
bootserport           tty0
urlader-version       97
bootloaderVersion     0.18.01 (computed, %d.%d.%02d)
mtd0                  0x900B0000,0x901F0000 (computed, 0x%X,0x%X)
mtd1                  0x90010000,0x900B0000 (computed, 0x%X,0x%X)
mtd2                  0x90000000,0x90010000 (computed, 0x%X,0x%X)
mtd3                  0x901F0000,0x901F8000 (computed, 0x%X,0x%X)
mtd4                  0x901F8000,0x90200000 (computed, 0x%X,0x%X)
firstfreeaddress      0x947310a8 (computed)
req_fullrate_freq     125000000 (computed)
sysfrequency          125000000 (computed)

This covers the complete environment except firmware_version and firmware_info.
Besides this all MAC addresses and a possible wlan_key are lost.

Another fallback in ADAM2 if maca is unset is to use 00:e0:a0:a6:66:70, an OUI of Wiltron Co, Morgan Hill, CA.

Never clear the TFFS partitions even if 1000 postings and tools recommend it. It always was a stupid messup!
Using the same MAC addresses everywhere is as stupid as opening an unprotected WLAN because of clearing the key.

Compression

ADAM2 never supported any Kernel compression, that's why a compressed Kernel needed its own decompression code.
This typically was a zimage decompressor which was prepended to the compressed Kernel and executed by ADAM2.

The smallest Flash size ever was 2 MB used in the FRITZ!Box SL, partitioned like this:

  • mtd0 - 1,280 KB - filesystem - squashfs
  • mtd1 - 640 KB - kernel - zimage
  • mtd2 - 64 KB - ADAM2
  • mtd3 - 32 KB - TFFS1
  • mtd4 - 32 KB - TFFS2

The oldest known Firmware (1.63) which is completely based on the TI SDK compiles to:

  • 1,511,424 bytes kernel (1,476 KB, uncompressed)
  • 1,294,344 bytes filesystem (1,264 KB, squashfs)

The zimage compressed kernel needs 655,368 bytes (640 KB) including decompressor,

Weblinks

SMW-Browser

Information is currently being retrieved from the backend.
 

Synonyms

Showing 1 related property.

A