1*4882a593SmuzhiyunIntro 2*4882a593Smuzhiyun----- 3*4882a593SmuzhiyunThe Buffalo Linkstation Pro/Live, codename LS-XHL and LS-CHLv2, is a single 4*4882a593Smuzhiyundisk NAS server. The PCBs of the LS-XHL and LS-CHLv2 are almost the same. 5*4882a593SmuzhiyunThe LS-XHL has a faster CPU and more RAM with a wider data bus, therefore 6*4882a593Smuzhiyunthe LS-XHL PCB has two SDRAM chips. Both have a Kirkwood CPU (Marvell 7*4882a593Smuzhiyun88F6281). The only on-board storage is a 4 Mbit SPI flash which stores the 8*4882a593Smuzhiyunbootloader and its environment. The linux kernel and the initial ramdisk 9*4882a593Smuzhiyunare loaded from the hard disk. 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunRescue Mode 13*4882a593Smuzhiyun----------- 14*4882a593SmuzhiyunThese linkstations don't have a populated serial port. There is no way to 15*4882a593Smuzhiyunaccess an (unmodified) board other than using the netconsole. If you want 16*4882a593Smuzhiyunto recover from a bad environment setting or an empty environment, you can 17*4882a593Smuzhiyundo this only with a working network connection. 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunTherefore, on entering the resuce mode, a random ethernet address is 20*4882a593Smuzhiyungenerated if no valid address could be loaded from the environment variable 21*4882a593Smuzhiyun'ethaddr' and a DHCP request is sent. After a successful DHCP response is 22*4882a593Smuzhiyunreceived, the network settings are configured and the ncip is unset. Thus 23*4882a593Smuzhiyunall netconsole packets are broadcasted and you can use the netconsole to 24*4882a593Smuzhiyunaccess board from any host within the network segment. To determine the IP 25*4882a593Smuzhiyunaddress assigned to the board, you either have to sniff the traffic or 26*4882a593Smuzhiyuncheck the logs/leases of your DHCP server. 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunThe resuce mode is selected by holding the push button for at least one 29*4882a593Smuzhiyunsecond, while powering-on the device. The status LED turns solid amber if 30*4882a593Smuzhiyunthe resuce mode is enabled, thus providing a visual feedback. 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunPressing the same button for at least 10 seconds on power-up will erase the 33*4882a593Smuzhiyunenvironment and reset the board. In this case the visual indication will 34*4882a593Smuzhiyunbe: 35*4882a593Smuzhiyun- blinking blue, for about one second 36*4882a593Smuzhiyun- solid amber, for about nine seconds 37*4882a593Smuzhiyun- blinking amber, until you release the button 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunThis ensures, that you still can recover a device with a broken 40*4882a593Smuzhiyunenvironment by first erasing the environment and then entering the rescue 41*4882a593Smuzhiyunmode. 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunOnce the rescue mode is started, use the ncb binary from the tools/ 44*4882a593Smuzhiyundirectory to access your board. There is a helper script named 45*4882a593Smuzhiyun'restore_env' to save your changes. It unsets all the network variables 46*4882a593Smuzhiyunwhich were set by the rescue mode, saves your changes and then resets the 47*4882a593Smuzhiyunboard. 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunThe common use case for this is setting a MAC address. Let us assume you 50*4882a593Smuzhiyunhave an empty environment, the board comes up with the amber LED blinking. 51*4882a593SmuzhiyunThen you enter the rescue mode, connect to the board with the ncb tool and 52*4882a593Smuzhiyunuse the following commands to set your MAC address: 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun setenv ethaddr 00:00:00:00:00:00 55*4882a593Smuzhiyun run restore_env 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunOf course you need to replace the 00:00:00:00:00:00 with your valid MAC 58*4882a593Smuzhiyunaddress, which can be found on a sticker on the bottom of your box. 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunStatus LED 62*4882a593Smuzhiyun---------- 63*4882a593Smuzhiyunblinking blue 64*4882a593Smuzhiyun Bootloader is running normally. 65*4882a593Smuzhiyun 66*4882a593Smuzhiyunblinking amber 67*4882a593Smuzhiyun No ethaddr set. Use the `Rescue Mode` to set one. 68*4882a593Smuzhiyun 69*4882a593Smuzhiyunblinking red 70*4882a593Smuzhiyun Something bad happend during loading the operating system. 71*4882a593Smuzhiyun 72*4882a593SmuzhiyunThe default behavior of the linux kernel is to turn on the blue LED. So if 73*4882a593Smuzhiyunthe blinking blue LED changes to solid blue the kernel was loaded 74*4882a593Smuzhiyunsuccessfully. 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun 77*4882a593SmuzhiyunPower-on Switch 78*4882a593Smuzhiyun--------------- 79*4882a593SmuzhiyunThe power-on switch is a software switch. If it is not in ON position when 80*4882a593Smuzhiyunthe bootloader starts, the bootloader will disable the HDD and USB power 81*4882a593Smuzhiyunand stop the fan. Then it loops until the switch is in ON position again, 82*4882a593Smuzhiyunenables the power and fan again and continue booting. 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun 85*4882a593SmuzhiyunBoot sources 86*4882a593Smuzhiyun------------ 87*4882a593SmuzhiyunThe environment defines several different boot sources: 88*4882a593Smuzhiyun 89*4882a593Smuzhiyunlegacy 90*4882a593Smuzhiyun This is the default boot source. It loads the kernel and ramdisk from the 91*4882a593Smuzhiyun attached HDD using the original filenames. The load addresses were 92*4882a593Smuzhiyun modified to support loading larger kernels. But it should behave the same 93*4882a593Smuzhiyun as the original bootloader. 94*4882a593Smuzhiyun 95*4882a593Smuzhiyunhdd 96*4882a593Smuzhiyun Use this for new-style booting. Loads three files /vmlinuz, /initrd.img 97*4882a593Smuzhiyun and /dtb from the boot partition. This should work out of the box if you 98*4882a593Smuzhiyun have debian and the flash-kernel package installed. 99*4882a593Smuzhiyun 100*4882a593Smuzhiyunusb 101*4882a593Smuzhiyun Same as hdd expect, that the files are loaded from an attached USB mass 102*4882a593Smuzhiyun storage device and the filename for the device tree is kirkwood-lsxhl.dtb 103*4882a593Smuzhiyun (or kirkwood-lschlv2.dtb). 104*4882a593Smuzhiyun 105*4882a593Smuzhiyunnet 106*4882a593Smuzhiyun Same as usb expect, that the file are loaded from the network. 107*4882a593Smuzhiyun 108*4882a593Smuzhiyunrescue 109*4882a593Smuzhiyun Automatically activated if the push button is pressed for at least one 110*4882a593Smuzhiyun second on power-up. Does a DHCP request and enables the network console. 111*4882a593Smuzhiyun See `Rescue Mode` for more information. 112*4882a593Smuzhiyun 113*4882a593SmuzhiyunYou can change the boot source by setting the 'bootsource' variable to the 114*4882a593Smuzhiyuncorresponding value. Please note, that the restore_env script will the the 115*4882a593Smuzhiyunbootsource back to 'legacy'. 116*4882a593Smuzhiyun 117*4882a593Smuzhiyun 118*4882a593SmuzhiyunFlash map 119*4882a593Smuzhiyun--------- 120*4882a593Smuzhiyun00000 - 5ffff u-boot 121*4882a593Smuzhiyun60000 - 6ffff reserved, may be used to store dtb 122*4882a593Smuzhiyun70000 - 7ffff u-boot environment 123*4882a593Smuzhiyun 124*4882a593Smuzhiyun 125*4882a593SmuzhiyunCompiling 126*4882a593Smuzhiyun--------- 127*4882a593Smuzhiyunmake lsxhl_config (or lschlv2_config) 128*4882a593Smuzhiyunmake u-boot.kwb 129*4882a593Smuzhiyun 130*4882a593Smuzhiyun 131*4882a593SmuzhiyunUpdate your board 132*4882a593Smuzhiyun----------------- 133*4882a593SmuzhiyunJust flash the resulting u-boot.kwb to the beginning of the SPI flash. If 134*4882a593Smuzhiyunyou already have a bootloader CLI, you can use the following commands: 135*4882a593Smuzhiyun 136*4882a593Smuzhiyun sf probe 0 137*4882a593Smuzhiyun bootp ${loadaddr} u-boot.kwb 138*4882a593Smuzhiyun sf erase 0 +${filelen} 139*4882a593Smuzhiyun sf write 0 ${fileaddr} ${filesize} 140