README 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. Intro
  2. -----
  3. The Buffalo Linkstation Pro/Live, codename LS-XHL and LS-CHLv2, is a single
  4. disk NAS server. The PCBs of the LS-XHL and LS-CHLv2 are almost the same.
  5. The LS-XHL has a faster CPU and more RAM with a wider data bus, therefore
  6. the LS-XHL PCB has two SDRAM chips. Both have a Kirkwood CPU (Marvell
  7. 88F6281). The only on-board storage is a 4 Mbit SPI flash which stores the
  8. bootloader and its environment. The linux kernel and the initial ramdisk
  9. are loaded from the hard disk.
  10. Important! Changes since v2019.07
  11. ---------------------------------
  12. In u-boot v2019.07 the driver for the SATA port was changed to a new
  13. one. This means that the old "ide" command and block interface is not
  14. supported anymore. More important, the boot commands have changed. You have
  15. to overwrite the boot commands in your envionment with the new ones:
  16. env default -f bootcmd_legacy
  17. env default -f bootcmd_hdd
  18. saveenv
  19. Rescue Mode
  20. -----------
  21. These linkstations don't have a populated serial port. There is no way to
  22. access an (unmodified) board other than using the netconsole. If you want
  23. to recover from a bad environment setting or an empty environment, you can
  24. do this only with a working network connection.
  25. Therefore, on entering the resuce mode, a random ethernet address is
  26. generated if no valid address could be loaded from the environment variable
  27. 'ethaddr' and a DHCP request is sent. After a successful DHCP response is
  28. received, the network settings are configured and the ncip is unset. Thus
  29. all netconsole packets are broadcasted and you can use the netconsole to
  30. access board from any host within the network segment. To determine the IP
  31. address assigned to the board, you either have to sniff the traffic or
  32. check the logs/leases of your DHCP server.
  33. The resuce mode is selected by holding the push button for at least one
  34. second, while powering-on the device. The status LED turns solid amber if
  35. the resuce mode is enabled, thus providing a visual feedback.
  36. Pressing the same button for at least 10 seconds on power-up will erase the
  37. environment and reset the board. In this case the visual indication will
  38. be:
  39. - blinking blue, for about one second
  40. - solid amber, for about nine seconds
  41. - blinking amber, until you release the button
  42. This ensures, that you still can recover a device with a broken
  43. environment by first erasing the environment and then entering the rescue
  44. mode.
  45. Once the rescue mode is started, use the ncb binary from the tools/
  46. directory to access your board. There is a helper script named
  47. 'restore_env' to save your changes. It unsets all the network variables
  48. which were set by the rescue mode, saves your changes and then resets the
  49. board.
  50. The common use case for this is setting a MAC address. Let us assume you
  51. have an empty environment, the board comes up with the amber LED blinking.
  52. Then you enter the rescue mode, connect to the board with the ncb tool and
  53. use the following commands to set your MAC address:
  54. setenv ethaddr 00:00:00:00:00:00
  55. run restore_env
  56. Of course you need to replace the 00:00:00:00:00:00 with your valid MAC
  57. address, which can be found on a sticker on the bottom of your box.
  58. Status LED
  59. ----------
  60. blinking blue
  61. Bootloader is running normally.
  62. blinking amber
  63. No ethaddr set. Use the `Rescue Mode` to set one.
  64. blinking red
  65. Something bad happend during loading the operating system.
  66. The default behavior of the linux kernel is to turn on the blue LED. So if
  67. the blinking blue LED changes to solid blue the kernel was loaded
  68. successfully.
  69. Power-on Switch
  70. ---------------
  71. The power-on switch is a software switch. If it is not in ON position when
  72. the bootloader starts, the bootloader will disable the HDD and USB power
  73. and stop the fan. Then it loops until the switch is in ON position again,
  74. enables the power and fan again and continue booting.
  75. Boot sources
  76. ------------
  77. The environment defines several different boot sources:
  78. legacy
  79. This is the default boot source. It loads the kernel and ramdisk from the
  80. attached HDD using the original filenames. The load addresses were
  81. modified to support loading larger kernels. But it should behave the same
  82. as the original bootloader.
  83. hdd
  84. Use this for new-style booting. Loads three files /vmlinuz, /initrd.img
  85. and /dtb from the boot partition. This should work out of the box if you
  86. have debian and the flash-kernel package installed.
  87. usb
  88. Same as hdd expect, that the files are loaded from an attached USB mass
  89. storage device and the filename for the device tree is kirkwood-lsxhl.dtb
  90. (or kirkwood-lschlv2.dtb).
  91. net
  92. Same as usb expect, that the file are loaded from the network.
  93. rescue
  94. Automatically activated if the push button is pressed for at least one
  95. second on power-up. Does a DHCP request and enables the network console.
  96. See `Rescue Mode` for more information.
  97. You can change the boot source by setting the 'bootsource' variable to the
  98. corresponding value. Please note, that the restore_env script will the the
  99. bootsource back to 'legacy'.
  100. Flash map
  101. ---------
  102. 00000 - 5ffff u-boot
  103. 60000 - 6ffff reserved, may be used to store dtb
  104. 70000 - 7ffff u-boot environment
  105. Compiling
  106. ---------
  107. make lsxhl_config (or lschlv2_config)
  108. make u-boot.kwb
  109. Update your board
  110. -----------------
  111. Just flash the resulting u-boot.kwb to the beginning of the SPI flash. If
  112. you already have a bootloader CLI, you can use the following commands:
  113. sf probe 0
  114. bootp ${loadaddr} u-boot.kwb
  115. sf erase 0 +${filelen}
  116. sf write 0 ${fileaddr} ${filesize}