meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nsa310:debian [2015/04/05 21:11] – niziak | hw:nsa310:debian [2020/11/30 09:42] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Debian ====== | ||
+ | |||
====== References ====== | ====== References ====== | ||
- | OpenWRT packages: [[http:// | + | OpenWRT packages: [[http:// |
- | [[http:// | + | [[http:// |
- | [[http:// | + | [[http:// |
- | [[https:// | + | [[https:// |
- | [[http:// | + | [[http:// |
- | [[http:// | + | [[http:// |
- | ====== Serial converter ====== | ||
- | 3,3V level converter 115200 8N1 | + | ====== Preparation ===== |
+ | First install Debian 6 (squeeze). | ||
+ | Put on FAT formatted pendrive: | ||
+ | [[http:// | ||
+ | [[http:// | ||
+ | [[http:// | ||
- | ^1 ^2 ^3 ^4^5 | | + | then boot from pendrive (one time, without saving it permanently to u-boot environment) |
- | |Vcc|RX|TX|nc|GND| | + | Machine type is [[http:// |
< | < | ||
+ | setenv arcNumber 4022 | ||
+ | setenv mainlineLinux yes | ||
+ | usb start | ||
+ | fatload usb 0 0x800000 /uImage-3.2 | ||
+ | fatload usb 0 0xb00000 /initrd.gz | ||
+ | setenv bootargs ' | ||
+ | bootm 0x800000 | ||
+ | </ | ||
- | _ _ | + | and install Debian 6 system |
- | | \/ | __ _ _ _____| | + | Installer will complain about no matching modules and no matching kernel. |
- | | + | During installation, create small /boot ext3 partition for kernels. |
- | | + | |
- | |_| | + | |
- | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | \__ _/ |/ \___/ \__ _/ \__| | + | |
- | ** MARVELL BOARD: RD-88F6281A LE | + | |
- | U-Boot 1.1.4 (Jun 8 2011 - 18:48:37) Marvell version: 3.4.19 | + | To boot from HDD, copy uImage-3.2 from pendrive to HDD /boot partition and set u-boot: |
- | U-Boot code: 00600000 -> 0067FFF0 | + | From u-boot console, test partitions readability: |
+ | <code> | ||
+ | ide reset | ||
+ | ide part | ||
+ | ext2ls ide 0:1 | ||
+ | ext2ls ide 0:3 | ||
+ | </code> | ||
- | Soc: 88F6281 A1 (DDR2) | + | In my example I got following partitions numbers: |
- | CPU running @ 1200Mhz L2 running @ 400Mhz | + | < |
- | SysClock = 400Mhz , TClock = 200Mhz | + | Partition Map for IDE device 0 -- |
- | DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6 | + | Partition |
- | DRAM CS[0] base 0x00000000 | + | |
- | DRAM Total size 256MB 16bit width | + | |
- | Addresses 10M - 0M are saved for the U-Boot usage. | + | |
- | Mem malloc Initialization (10M - 7M): Done | + | </ |
- | NAND:128 MB | + | |
- | Flash: | + | |
- | CPU : Marvell Feroceon (Rev 1) | + | Where 3rd partition |
- | Kernel address | + | |
- | Streaming disabled | ||
- | Write allocate disabled | ||
- | Module | + | < |
- | Module 1 is TDM | + | setenv arcNumber 4022 |
+ | setenv mainlineLinux yes | ||
+ | setenv bootargs ' | ||
+ | setenv bootcmd 'ide reset; ext2load ide 0:3 0x800000 / | ||
+ | saveenv | ||
+ | reset | ||
+ | </ | ||
- | USB 0: host mode | + | or 3.5.1 kernel: |
- | PEX 0: PCI Express Root Complex Interface | + | |
- | PEX interface detected Link X1 | + | |
- | Net: | + | |
- | Hit any key to stop autoboot: | + | |
- | ** | + | < |
- | </code> | + | |
+ | </code> | ||
- | ** ~~COMPLEX_TABLES~~ ** | + | ====== Update to Debian Wheezy ====== |
+ | Put following sources into / | ||
+ | < | ||
+ | ###### Debian Main Repos | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
- | **====== Features ====== * LM-Sensors are working. You can check values using command ' | + | ###### Debian Update Repos |
+ | deb http:// | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | deb-src http:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | apt-get update | ||
+ | apt-get dist-upgrade | ||
+ | |||
+ | apt-get install linux-base firmware-realtek | ||
+ | apt-get clean | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Fine tunning ====== | ||
+ | Install missing packages: | ||
+ | < | ||
+ | apt-get install uboot-envtools smartmontools strace watchdog hdparm | ||
+ | </ | ||
+ | |||
+ | ===== Generate blank modules.dep ===== | ||
+ | < | ||
+ | mkdir / | ||
+ | depmod -a | ||
+ | </ | ||
+ | |||
+ | ===== LEDs ===== | ||
+ | To turn ON System LED (disable blinking) please add line to / | ||
+ | < | ||
+ | |||
+ | ===== uboot-envtools ===== | ||
+ | Create / | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== MAC address ===== | ||
+ | After bootup, ethernet controller has MAC address ' | ||
+ | There are several method to restore correct MAC address which can be obtained from u-boot env: | ||
+ | 1) add to / | ||
+ | < | ||
+ | ifdown eth0 | ||
+ | / | ||
+ | ifup eth0 | ||
+ | </ | ||
+ | or | ||
+ | < | ||
+ | /sbin/ip link set eth0 address `/ | ||
+ | </ | ||
+ | |||
+ | 2) add line to / | ||
+ | < | ||
+ | hwaddress ether cc: | ||
+ | </ | ||
+ | |||
+ | 3) Edit and set MAC here: | ||
+ | / | ||
+ | |||
+ | Wake-on-lan will work only with fake MAC ' | ||
+ | |||
+ | |||
+ | ===== Fix for alloc kernel panic ===== | ||
+ | Add these lines in / | ||
+ | < | ||
+ | # Set VM min memory | ||
+ | vm.min_free_kbytes=8192 | ||
+ | </ | ||
+ | |||
+ | ===== Buttons ===== | ||
+ | |||
+ | Ref: [[http:// | ||
+ | Button works, but requires long pressing > 1sec. | ||
+ | |||
+ | |||
+ | ===== Fan ===== | ||
+ | |||
+ | Detect PWM devices and calibrate fan RPMs using ' | ||
+ | After many questions an tests the config file / | ||
+ | < | ||
+ | # Configuration file generated by pwmconfig, changes will be lost | ||
+ | INTERVAL=10 | ||
+ | DEVPATH=hwmon0=devices/ | ||
+ | DEVNAME=hwmon0=lm85 | ||
+ | FCTEMPS=hwmon0/ | ||
+ | FCFANS= hwmon0/ | ||
+ | MINTEMP=hwmon0/ | ||
+ | MAXTEMP=hwmon0/ | ||
+ | MINSTART=hwmon0/ | ||
+ | MINSTOP=hwmon0/ | ||
+ | MINPWM=hwmon0/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Features ====== | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ====== Own kernel ====== | ||
+ | There's no need to keep pestering the poor guy over simple config changes. It's easy to build your own kernel; the instructions are right there in the first post. On a debian host you need to add the emdebian repo and install gcc-4.7-arm-linux-gnueabi (or whatever version) and u-boot-tools to build the kernel. | ||
+ | |||
+ | I just built one with device mapper and crypto target support, and threw in netfilter NAT stuff for giggles. | ||
+ | |||
+ | Here it is: http:// | ||
+ | And the .config: http:// | ||
+ | |||
+ | |||
+ | ===== Kernel 3.18 ===== | ||
+ | |||
+ | Download lastest Jessie rootfs from: [[http:// | ||
+ | |||
+ | Or locally: {{hw: | ||
+ | |||
+ | Unpack rootfs to media, can be USB pendrive for now. | ||
+ | |||
+ | < | ||
+ | cd /mnt/sdd1 | ||
+ | tar -xjf Debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2 | ||
+ | </ | ||
+ | |||
+ | Inside rootfs, there is /boot directory which contains bootable kernel, initrd and deveice trees. Go to newly unpacked roots directory and create images recognizable by u-boot. If command //mkimage// is missing, please install // | ||
+ | ===== Boot without Flattened Device Tree ===== | ||
+ | |||
+ | This method is supported by old (stock) U-BOOT. In this case FDT structure is appended at end of kernel. | ||
+ | |||
+ | < | ||
+ | cd /boot | ||
+ | cp -a zImage-3.18.5-kirkwood-tld-1 zImage.fdt | ||
+ | cat dts/ | ||
+ | |||
+ | mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-3.18.5-kirkwood-tld-1 -d ./ | ||
+ | mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.18.5-kirkwood-tld-1 -d ./ | ||
+ | </ | ||
+ | |||
+ | Test if kernel starts correctly from pendrive: | ||
+ | |||
+ | < | ||
+ | usb start | ||
+ | fatload usb 0 0x800000 / | ||
+ | fatload usb 0 0x1100000 / | ||
+ | bootm 0x800000 0x1100000 | ||
+ | </ | ||
+ | |||
+ | Boot from HDD (separate small /boot partition, so no /boot prefix in filenames): | ||
+ | |||
+ | < | ||
+ | ide reset | ||
+ | ext2load ide 0:3 0x800000 / | ||
+ | ext2load ide 0:3 0x1100000 / | ||
+ | bootm 0x800000 0x1100000 | ||
+ | </ | ||
- | {{: | + | ===== Boot with Flattened Device Tree ===== |
+ | **NOT SUPPORTED BY OLD (default U-BOOT)** | ||
< | < | ||
cd boot | cd boot | ||
Line 100: | Line 273: | ||
</ | </ | ||
- | === Adapt own devie tree file === | + | ===== Adapt own devie tree file ===== |
There are multiple HW versions of NSA310 on market, but only 2 device tree are defined in kernel: | There are multiple HW versions of NSA310 on market, but only 2 device tree are defined in kernel: | ||
- | |||
- kirkwood-nsa310.dtb - all LEDs are bicolor (red and green), sensors device ' | - kirkwood-nsa310.dtb - all LEDs are bicolor (red and green), sensors device ' | ||
- kirkwood-nsa310a.dtb - like above but without red USB led, and sensor device ' | - kirkwood-nsa310a.dtb - like above but without red USB led, and sensor device ' | ||
- | My NSA310 version is like nsa310 but with lm85 :), so I've created {{: | + | My NSA310 version is like nsa310 but with lm85 :), so I've created {{hw: |
< | < | ||
Line 119: | Line 290: | ||
== apt source == | == apt source == | ||
- | Adapt to your country location in /// | + | Adapt to your country location in /// |
< | < | ||
apt-get update | apt-get update | ||
Line 127: | Line 297: | ||
</ | </ | ||
- | RAM disk will be regenerated, | + | RAM disk will be regenerated, |
== Enable LEDs == | == Enable LEDs == | ||
- | + | Adapt /// | |
- | Adapt /// | + | |
< | < | ||
if [ -d / | if [ -d / | ||
echo default-on> | echo default-on> | ||
- | echo none | + | echo none > / |
fi | fi | ||
Line 153: | Line 322: | ||
== turn off HDD when idle == | == turn off HDD when idle == | ||
- | |||
* by default busybox-syslogd is installed, with logging to RAM | * by default busybox-syslogd is installed, with logging to RAM | ||
* mount working dir for samba and dhcp client as tmpfs | * mount working dir for samba and dhcp client as tmpfs | ||
* switch Samba to use syslog | * switch Samba to use syslog | ||
* tune system / | * tune system / | ||
+ | * '' | ||
+ | * put it on tmpfs (and lose history) | ||
+ | * or increase disc check interval in ''/ | ||
== repair / | == repair / | ||
- | |||
add new line at end of / | add new line at end of / | ||
Line 172: | Line 342: | ||
====== TODO ====== | ====== TODO ====== | ||
- | + | linux-headers-3.2.0-4-kirkwood - Header files for Linux 3.2.0-4-kirkwood | |
- | linux-headers-3.2.0-4-kirkwood - Header files for Linux 3.2.0-4-kirkwood linux-image-3.2.0-4-kirkwood - Linux 3.2 for Marvell Kirkwood linux-headers-2.6-kirkwood - Header files for Linux kirkwood configuration (dummy package) linux-headers-kirkwood - Header files for Linux kirkwood configuration (meta-package) linux-image-2.6-kirkwood - Linux for Marvell Kirkwood (dummy package) linux-image-kirkwood - Linux for Marvell Kirkwood (meta-package) | + | linux-image-3.2.0-4-kirkwood - Linux 3.2 for Marvell Kirkwood |
- | + | linux-headers-2.6-kirkwood - Header files for Linux kirkwood configuration (dummy package) | |
- | \\ | + | linux-headers-kirkwood - Header files for Linux kirkwood configuration (meta-package) |
+ | linux-image-2.6-kirkwood - Linux for Marvell Kirkwood (dummy package) | ||
+ | linux-image-kirkwood - Linux for Marvell Kirkwood (meta-package) |