2012-05-29 16:39:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2015-12-03 22:27:18 +00:00
|
|
|
# Copyright (C) 2012-2015 OpenWrt.org
|
2012-05-29 16:39:15 +00:00
|
|
|
#
|
|
|
|
|
2015-12-11 15:26:06 +00:00
|
|
|
. /lib/functions/uci-defaults.sh
|
2017-02-23 18:42:40 +00:00
|
|
|
. /lib/functions/system.sh
|
2014-06-24 18:18:53 +00:00
|
|
|
|
2015-12-03 22:27:18 +00:00
|
|
|
board_config_update
|
2012-05-29 16:39:15 +00:00
|
|
|
|
2017-05-12 20:36:07 +00:00
|
|
|
board=$(board_name)
|
2015-12-03 22:27:18 +00:00
|
|
|
|
2014-06-24 18:18:53 +00:00
|
|
|
case "$board" in
|
2018-01-08 22:49:22 +00:00
|
|
|
"cisco,on100")
|
|
|
|
ucidef_set_interface_lan "eth0 eth1"
|
|
|
|
;;
|
|
|
|
"cloudengines,pogoe02"|\
|
|
|
|
"cloudengines,pogoplugv4"|\
|
|
|
|
"iom,iconnect-1.1"|\
|
kirkwood: add support for Iomega Storcenter ix2-200
Iomega Storcenter ix2-200 is a dual SATA NAS powered by a Marvell
Kirkwood SoC clocked at 1GHz. It has 256MB of RAM and 32MB of
flash memory, 3x USB 2.0 and 1x 1Gbit/s NIC
Specification:
- SoC: Marvell Kirkwood 88F6281
- CPU/Speed: 1000Mhz
- Flash-Chip: Hynix NAND
- Flash size: 32 MiB,erase size:16 KiB,page size:512,OOB size:16
- RAM: 256MB
- LAN: 1x 1000 Mbps Ethernet
- WiFi: none
- 3x USB 2.0
- UART: for serial console
Installation instructions - easy steps:
1. download factory.bin and copy into tftp server
2. access uboot environment with serial cable and run
```
setenv mainlineLinux yes
setenv arcNumber 1682
setenv console 'console=ttyS0,115200n8'
setenv mtdparts 'mtdparts=orion_nand:0x100000@0x000000(u-boot)ro,0x20000@0xA0000(u-boot environment)ro,0x300000@0x100000(kernel),0x1C00000@0x400000(ubi)'
setenv bootargs_root 'root='
setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0x100000 0x300000; bootm 0x00800000'
saveenv
setenv serverip 192.168.1.1
setenv ipaddr 192.168.1.13
tftpboot 0x00800000 factory.bin
nand erase 0x100000 $(filesize)
nand write 0x00800000 0x100000 $(filesize)
run bootcmd
```
3. access openwrt by dhcp ip address assigned by your router (p.ex: 192.168.1.13)
Installation steps nand bad blocks proof:
1. download initramfs-uImage and copy into usb ext2 partition
```
mkfs.ext2 -L ext2 /dev/sdh1
mount -t ext2 /dev/sdh1 /mnt
cp initramfs-uImage /mnt/initramfs.bin
umount /mnt
```
2. access uboot environment with serial cable and run
```
setenv mainlineLinux yes
setenv arcNumber 1682
setenv console 'console=ttyS0,115200n8'
setenv mtdparts 'mtdparts=orion_nand:0x100000@0x000000(u-boot)ro,0x20000@0xA0000(u-boot environment)ro,0x300000@0x100000(kernel),0x1C00000@0x400000(ubi)'
setenv bootargs_root 'root='
setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0x100000 0x300000; bootm 0x00800000'
saveenv
usb reset; ext2load usb 0:1 0x00800000 /initramfs.bin; bootm 0x00800000
```
3. log into openwrt and sysupgrade to install into flash
```
sysupgrade -n /tmp/sysupgrade.bin
```
4. access openwrt by dhcp ip address assigned by your router (p.ex: 192.168.1.13)
Signed-off-by: Ademar Arvati Filho <arvati@hotmail.com>
2018-07-06 00:56:58 +00:00
|
|
|
"iom,ix2-200"|\
|
2018-01-08 22:49:22 +00:00
|
|
|
"raidsonic,ib-nas62x0"|\
|
2017-12-28 09:18:48 +00:00
|
|
|
"seagate,dockstar"|\
|
|
|
|
"seagate,goflexhome"|\
|
2018-01-08 22:49:22 +00:00
|
|
|
"seagate,goflexnet")
|
2015-12-03 22:27:18 +00:00
|
|
|
ucidef_set_interface_lan "eth0" "dhcp"
|
2013-10-31 12:04:04 +00:00
|
|
|
;;
|
2017-12-28 09:18:48 +00:00
|
|
|
"linksys,audi"|\
|
|
|
|
"linksys,viper")
|
2015-12-03 22:27:18 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
|
2014-05-28 21:43:39 +00:00
|
|
|
;;
|
2018-01-08 22:49:22 +00:00
|
|
|
"zyxel,nsa310b"|\
|
|
|
|
"zyxel,nsa325")
|
kirkwood: add ZyXEL NSA310b
The ZyXEL NSA310 device is a Kirkwood based NAS:
- SoC: Marvell 88F6702 1200Mhz
- SDRAM memory: 256MB DDR2 400Mhz
- Gigabit ethernet: Realtek (over pcie)
- Flash memory: 128MB
- 1 Power button
- 1 Power LED (blue)
- 5 Status LED (green/red)
- 1 Copy/Sync button
- 1 Reset button
- 2 SATA II port (1 internal and 1 external)
- 2 USB 2.0 ports (1 front and 1 back)
- Smart fan
The stock u-boot cannot read ubi so it should be replaced with the
LEDE/OpenWRT's u-boot or with a u-boot from here
https://github.com/mibodhi/u-boot-kirkwood
This device's boot ROM supports "kwboot" tool
(in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared)
that sends an uboot image to the board over serial connection, it is very easy to unbrick.
The stock bootloader can use usb and read from FAT filesystems,
so the installation process is simple, place the uboot file on a USB flashdrive
formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL
to the board and write the following commands in the bootloader console:
usb reset
fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin
nand write 0x1000000 0x00000 0x100000
reset
Now you are rebooting in the new u-boot, write this in its console to install the firmware:
usb reset
fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin
nand erase.part ubi
nand write 0x2000000 ubi 0x600000
If your firmware file is bigger than 6 MiBs you should write its size in hex
instead of 0x600000 above, or remove that number entirely (it will take a while in this case).
If you are using another uboot that can read ubi, set mtdparts like this
mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)
And set your bootcmd to be like this
bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
Then you can install the firmware as described above.
After you installed (or configured) the u-boot for booting the firmware,
write the device's mac address in the ethaddr u-boot env.
The MAC address is usually on a sticker under the device (one of the two codes is the serial),
it should begin with "107BEF" as it is assigned to ZyXEL.
write in the u-boot console (use your MAC address instead of the example)
setenv ethaddr 10:7B:EF:00:00:00
saveenv
to save the mac address in the u-boot.
Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
2017-01-23 19:34:29 +00:00
|
|
|
ucidef_set_interface_lan "eth0" "dhcp"
|
2017-02-06 09:20:47 +00:00
|
|
|
ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr )
|
2014-12-19 11:05:13 +00:00
|
|
|
;;
|
2012-05-29 16:39:15 +00:00
|
|
|
*)
|
2016-09-10 07:46:14 +00:00
|
|
|
ucidef_set_interface_lan "eth0"
|
2012-05-29 16:39:15 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2015-12-03 23:13:04 +00:00
|
|
|
board_config_flush
|
2012-05-29 16:39:15 +00:00
|
|
|
|
|
|
|
exit 0
|