Skip to content
Philipp Kirchhofer edited this page Aug 30, 2014 · 9 revisions

Welcome to the ZyXEL NSA325 wiki. If you want to run a state-of-the-art Linux kernel on the ZyXEL NSA 325, read on!

Note: The repository nsa325-kernel will not be updated any more. Please use the repository nsa325-linux-upstream instead.

Tested and works:

  • All LEDs (SATA1/SATA2/Copy Green/Red, System Green/Orange, USB Green)
  • Network (Booting with NFS as root file system works)
  • Shutdown using "Power off" GPIO
  • Serial interface
  • RTC (pcf8563)
  • USB 2.0 (with "USB power enable" GPIO)
  • USB 3.0 (xHCI controller)
  • Buttons (Power, Copy, Reset)
  • SATA (2 Ports)
  • NAND flash

Currently unsupported:

  • MCU

Other wiki pages:

Stock firmware U-Boot environment variables

MPP GPIO map

Useful links:

Marvell Kirkwood 88F6281 SoC Hardware Spec and Functional Spec

The 88F6281 SoC is very similar to the 88F6282 on the NSA325. These documents contain memory and register maps, function descriptions and other useful low-level hardware related stuff:

http://www.marvell.com/embedded-processors/kirkwood/

How to get access to U-Boot bootloader and serial console

Serial port pinout: http://zyxel.nas-central.org/wiki/Serial_port_%28NSA325%29

Connect TX, RX and GND to an LV-TTL (3.3V) <-> USB interface.

Boot from USB device

The U-Boot bootloader in the NSA325 supports loading a linux kernel image from an USB device (e.g. stick or hard drive). The image can be located on either an FAT or EXT2 file system. An USB device can unfortunately not be directly used with the stock bootloader settings, as the USB ports are powered off after system power on. The following instructions show how to enable USB power and boot from an USB device:

The internal registers of the CPU are memory-mapped, so lets enable LEDs and USB power by setting the appropriate register values. For more information see the 88F6281 functional specs, pages 762 ff. and the MPP GPIO map.

  1. Enable USB led and USB power

     Marvell>> mw.l f1010100 0020c000
    
  2. (Optionally) Enable system led blinking

     Marvell>> mw.l f1010108 10000000
    

Power to the USB ports is now enabled. Note: Only the USB 2.0 ports located on the back work in U-Boot. The USB 3.0 port at the front can not be used as a boot interface, as they are not directly connected to the processor.

  1. Start USB subsystem

     Marvell>> usb reset
    
  2. Load kernel image from FAT or EXT2 filesystem. This example loads the image from the first partition on the first device using filename "uImage".

     Marvell>> fatload usb 0:1 $(loadaddr) uImage
     or
     Marvell>> ext2load usb 0:1 $(loadaddr) uImage
    
  3. Execute the kernel image

     Marvell>> bootm $(loadaddr)
    

To permanently execute these steps on each power on:

    Marvell>> setenv enable_usb 'mw.l f1010108 10000000; mw.l f1010100 0020c000'
    Marvell>> setenv bootcmd_usb 'run enable_usb; usb reset; fatload usb 0:1 $(loadaddr) uImage; bootm $(loadaddr)'
    Marvell>> setenv bootcmd 'run bootcmd_usb'
    Marvell>> saveenv

How to get/set U-Boot variables in user space

  1. Install debian package "u-boot-tools"

  2. Setup /etc/fw_env.config

     # MTD device name   Device offset   Env. size   Flash sector size
     /dev/mtd1           0x0             0x20000     0x20000
    
  3. Do stuff with fw_printenv/fw_setenv

How to shutdown using the power button

  1. Install debian package "acpid"

  2. Setup files

    /etc/acpi/events/button_power

     event=button/power
     action=/bin/sh /etc/acpi/shutdown.sh
    

    /etc/acpi/shutdown.sh

     #!/bin/sh
     echo timer > /sys/class/leds/nsa325:green:sys/trigger
     echo none > /sys/class/leds/nsa325:orange:sys/trigger
     /sbin/shutdown -h now "Power button pressed"
    
  3. Reload acpid configuration

      /etc/init.d/acpid reload