import u-boot-1.1.4-list-2.1.0.diff
[u-boot.git] / board / linkstation / INSTALL
1
2                      Installing U-Boot for LinkStation
3
4                        For U-Boot port version 2.1.0
5                              16 September 2006
6
7    Copyright (c) 2006 Mihai Georgian
8
9    Permission is granted to copy, distribute and/or modify this document under
10    the terms of the [1]GNU Free Documentation License, Version 1.2 or any later
11    version  published  by the Free Software Foundation; with no Invariant
12    Sections, no Front-Cover Texts, and no Back-Cover Texts. The full text of
13    the license can be obtained by clicking on the above link.
14
15    No  liability  for  the contents of this document can be accepted. The
16    information in this document is provided in good faith but no warranty can
17    be made for its accuracy and the author does not take any responsibility.
18    Use the concepts, examples and information at your own risk. There may be
19    errors and inaccuracies, that could be damaging to your system.
20
21    Use of a term in this document should not be regarded as affecting the
22    validity of any trademark or service mark. Naming of particular products or
23    brands should not be seen as endorsements.
24      _________________________________________________________________
25
26    WARNING
27
28    Flashing the LinkStation with unauthorised firmare voids your warranty. When
29    installing firmware on an embedded computer things can and, sometimes, do go
30    wrong. The power can go down in the middle of the flash operation or the
31    flash write can fail rendering your LinkStation unusable. Please read this
32    entire page carefully before attempting to install U-Boot. 
33
34    If you are not prepared to lose your LinkStation, do not attempt to install
35                                      U-Boot 
36
37   Introduction
38
39    U-Boot  for  the  LinkStation is distributed as a source patch against
40    u-boot-1.1.4. To compile it you will need either a cross toolchain installed
41    on your PC or native development tools installed on your LinkStation. These
42    instructions assume that you are running Linux on a X86 PC and that you are
43    using a cross toolchain.
44
45    To allow testing of U-Boot on your LinkStation without burning it into
46    flash, a kernel module named uloader.o is provided. Uloader allows you to
47    use Linux to load a RAM build of U-Boot and start it. The RAM build of
48    U-Boot is very close to the ROM build. The only differences are the absence
49    of the basic initialisation code (which cannot run from RAM) and the link
50    address. It is strongly recommended that you test U-Boot on your LinkStation
51    using a RAM build before building the ROM version and attempting to burn it
52    into flash. Once you have the RAM build up and running you can use it to
53    install (burn) the ROM version.
54
55   Supported Hardware
56
57    The LinkStation port of U-Boot described in this document supports the
58    following PowerPC based models:
59     1. LinkStation version 1 (model HD-HLAN-1)
60     2. KuroBox standard
61     3. LinkStation HG (model HD-HGLAN)
62     4. KuroBox HG
63
64    This version of U-Boot will certainly not work on the the LinkStation
65    version 2 (model HD-HLAN-2) as the LinkStation version 2 is based on a MIPS
66    processor. The MIPS processor is completely different from the PowerPC
67    processor and attempting to flash a LinkStation version 2 with PowerPC
68       firmware it is guaranteed to make it completely unusable. 
69
70   Get telnet Access
71
72    Try to connect to your LinkStation using telnet. If you see the telnet
73    command prompt, read [2]CGI Exploit (PowerPC) original method of Hacking the
74    LinkStation about how to get telnet access.
75
76    If the above method doesn't work for you, read [3]Turn your LinkStation into
77    a Kuro Box (PowerPC) for other methods to get telnet access.
78
79    The above methods do not work for the LinkStation HG. For this model, the
80    only solution is to load a telnet-enabled version of the firmware. Read the
81    pages about [4]OpenLink and the [5]firmware flasher
82
83    You can also try to flash [6]a modified version of the original firmware.
84
85   Install the Serial Console
86
87    Installing the serial console is not an absolute requirement and it will
88    void your warranty. U-Boot can be installed and controlled without it.
89    However, the serial console will give you the best control over both U-Boot
90                                    and Linux. 
91
92    Read [7]Add a Serial port to the PowerPC Linkstation to learn how to install
93    the serial console.
94
95   Install netcat (nc)
96
97    If you haven't installed the serial console you will need to install netcat
98    (nc). Netcat is a networking utility which reads and writes data across
99    network connections, using the TCP/IP protocol. It comes standard with most
100    Linux  distributions. For more information, visit the netcat home page
101    [8]http://netcat.sourceforge.net or [9]http://www.vulnwatch.org/netcat for
102    the Windows version.
103
104   Get the ELDK
105
106    If you don't have a cross toolchain installed, download the DENX Embedded
107    Linux Development Kit (ELDK) from
108    [10]http://ftp.sunet.se/pub/Linux/distributions/eldk/3.1.1/ppc-linux-x86/iso
109    /ppc-2005-03-07.iso, install it and spend some time getting familiar with
110    it.
111
112   Preparation
113
114    Create the build directory and set the environment variable UBOOT_BUILD to
115    the path to it
116    # mkdir <your_build_directory>
117    # export UBOOT_BUILD=<your_build_directory>
118    # cd $UBOOT_BUILD
119    Download the tarball for u-boot-1.1.4 from
120    [11]ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2
121    Download the LinkStation patch, [12]u-boot-1.1.4-list-2.1.0.diff.gz 
122    Download the uloader module for your LinkStation / KuroBox model.
123      * For    the    LinkStation   1   /   KuroBox   standard,   download
124        [13]uloader-2.4.17.tar.gz 
125      * For the LinkStation HG / KuroBox HG, download [14]uloader-2.4.20.tar.gz 
126
127    Untar u-boot-1.1.4 and apply the patch.
128    # tar xjf u-boot-1.1.4.tar.bz2
129    # cd u-boot-1.1.4
130    # gunzip ../u-boot-1.1.4-list-2.01.diff.gz | patch -p1
131
132    Untar the uloader archive for your LinkStation / KuroBox model. The archive
133    contains  the  source  code, a binary module compiled for the original
134    LinkStation kernel and a simple bash script to load and start a RAM build of
135    U-Boot.
136
137    The binary in uloader-2.4.17.tar.gz has been compiled against
138    2.4.17_mvl21-sandpoint. Use only on the LinkStation 1 / KuroBox standard.
139    The binary in uloader-2.4.20.tar.gz has been compiled against
140    2.4.20_mvl31-ppc_linkstation. Use only on the LinkStation HG / KuroBog HG.
141    If you have a different kernel version, you may need to recompile the module
142    for your kernel. Compiling the module requires a fully configured kernel
143    source tree. It is recommended to use the same gcc version as the one used
144    to compile the kernel. There is a small but important difference between the
145    two uloader source archives. The difference is the U-Boot load address. If
146    you compile uloader for the LinkStation 1 / KuroBox standard, use the
147    sources in uloader-2.4.17.tar.gz. If you compile for the LinkStation HG /
148    KuroBox HG, use the sources in uloader-2.4.20.tar.gz. In both cases you
149    need to modify the Makefile to match your development environment. 
150
151    LinkStation 1 / KuroBox standard
152    # cd ..
153    # tar xzf uloader-2.4.17.tar.gz
154    # cd u-boot-1.1.4
155
156    LinkStation HG / KuroBox HG
157    # cd ..
158    # tar xzf uloader-2.4.20.tar.gz
159    # cd u-boot-1.1.4
160
161    Source your ELDK environment
162    # . <path_to_your_ELDK>/config_6xx
163
164   Configure
165
166    Edit include/configs/linkstation.h and set the following variables for your
167    environment:
168
169    CONFIG_IPADDR_LS    -  the IP address of your LinkStation while running
170                           U-Boot (mandatory). The default address is
171                           192.168.11.150.
172    CONFIG_SERVERIP_LS  -  the IP address of the NFS/TFTP/DHCP/BOOTP server,
173                           normally the address of your Linux PC (mandatory).
174                           The default address is 192.168.11.149.
175    CONFIG_NCIP_LS      -  the address of the computer running netcat (nc),
176                           normally the address of your Linux PC (optional).
177                           If the define is missing, CONFIG_NCIP_LS will be
178                           set to the same value as CONFIG_SERVERIP_LS
179
180   RAM Build
181
182    For LinkStation 1 / KuroBox standard run:
183    make linkstation_HDLAN_RAM_config
184    make linkstation_HDLAN_RAM
185
186    The name of the resulting binary is u-boot-hd.ram.bin
187
188    For LinkStation HG / KuroBox HG run:
189    make linkstation_HGLAN_RAM_config
190    make linkstation_HGLAN_RAM
191
192    The name of the resulting binary is u-boot-hg.ram.bin
193
194   Net Console
195
196    The net console is the U-Boot driver which uses the UDP protocol with a
197    default port of 6666 to send the console output to and receive the console
198    input from a remote computer. You need to run netcat on the remote computer
199    to  communicate  with  the  U-Boot  net  console. The communication is
200    bidirectional.  Netcat  will display on your screen the console output
201    received from U-Boot and will send your keyboard input back to U-Boot.
202
203    If U-Boot cannot contact the remote computer, it switches the console to the
204    serial port. To show that it changed the console, U-Boot makes the HDD LED
205    blink with the pattern corresponding to the serial console (see The Reset
206    Button below). The timeout period is 20 sec.
207
208   Minimal Console
209
210    U-Boot for the LinkStation is designed to allow some control over the boot
211    process even in the absence of a console. For this, it uses the power button
212    (the big button at the front) and the reset button (the small red button at
213    the back).
214
215    Before installing U-Boot, when the LinkStation is switched on, the power LED
216    starts  blinking,  the original boot loader starts executing and, very
217    quickly, it starts booting the kernel from flash. If U-Boot is installed,
218    the power LED will change from blinking quickly to blinking very slowly. The
219    blink pattern is the same as the one used to indicate sleep mode in normal
220    operation. When the power LED starts blinking slowly at boot, U-Boot has
221    taken over and it is counting down the boot delay before booting the kernel.
222    The default boot delay is 10 sec. From the moment when the power LED starts
223    blinking slowly and for the duration of the boot delay, you can control the
224    boot process with the power and reset buttons.
225
226     The Power Button
227
228    If you push the power button and keep it pressed for more than 1 sec, the
229    boot  process will stop and the LinkStation will wait for a command. A
230    stopped boot process is indicated by the power LED being lit solid. The
231    effect is the same a pressing 's' on the console.
232
233    A long push of the power button acts as a toggle. If the boot delay count
234    down is in progress, a long push of the power button stops the boot process.
235    If the boot process is stopped (U-Boot is at the command prompt, even if you
236    can't see it), a long push of the power button restarts the boot process
237    resetting the boot delay to its original value. The restart of the boot
238    process is indicated by the power LED blinking slowly.
239
240    By default U-Boot supports three pre-configured boot commands:
241     1. The  first boot command will attempt to load and boot a file named
242        boot/vmlinux.UBoot from the first hard disk partition, /dev/hda1. The
243        file can be in any of the U-Boot bootable formats but uImage is the
244        preferred format. If the file is missing or corrupted, U-Boot will fall
245        back to booting the original kernel from flash.
246     2. The second boot command will boot the original kernel from flash.
247        Please note that the original kernel for the LinkStation 1 / KuroBox
248        standard has a bug in the function that calibrates the decrementer and
249        it will stop for up to 180 sec during boot. This bug is not an U-Boot
250        bug  but  a  kernel bug which is uncovered by the fact that U-Boot
251        activates the decrementer where the original boot loader does not.
252        The original kernel for LinkStation HG / KuroBox HG does not suffer from
253        the above problem.
254     3. The third boot command will attempt to boot in emergency mode (EM). It
255        does this by passing the argument root=/dev/ram0 to the kernel.
256        LinkStation / LinkStation HG owners should avoid booting in EM mode as
257        the root password for this mode on the LinkStation is unknown. 
258        The original kernel for the LinkStation / KuroBox standard and for some
259        of the earlier LinkStation HG / KuroBox HG models ignores the root
260        argument. These models will boot normally from the on-board flash when
261        the  EM  boot command is used. Read the section on EM mode if your
262        LinkStation HG / KuroBox HG has a kernel that doesn't boot in EM mode
263        using this boot command.
264
265    You can cycle through the boot commands with the power button.
266
267    To see which of the three commands U-Boot is going to execute, press the
268    power  button quickly. The HDD LED (the third from the top) will start
269    blinking. The number of times the LED blinks, shows the number of the active
270    boot command. For example, a pattern short on - short off - short on - long
271    off, means that the boot command number 2 is active. U-Boot will repeat the
272    blinking cycle for a total duration of about 5 sec counting from the moment
273    the power button is released.
274
275    A short press of the power button while the HDD LED is blinking will advance
276    the boot command to the next one.
277
278    Changing the boot command does not change the boot status. If the boot is
279    stopped, it will not be restarted. If the boot is in progress, it will not
280    be stopped but the boot delay will be reset to the original value.
281
282     The Reset Button
283
284    Two  consoles are currently configured, the serial console and the net
285    console. The first console is the serial console and the second console is
286    the net console (nc). The net console is the default console.
287
288    The reset button can be used, similarly to the power button, to switch
289    consoles. A press on the reset button (here, it doesn't matter how long you
290    keep the button pressed) displays the currently active console using the HDD
291    LED. Repeatedly pressing the reset button while the HDD LED is blinking will
292    toggle between the two consoles. The blinking pattern is different from the
293    one showing the boot command. The pattern which shows that the second (net)
294    console is active is short off - short on - short off - long on. U-Boot will
295    repeat the blinking cycle for a total duration of about 5 sec counting from
296    the moment the reset button is released.
297
298   Load and Test
299
300    Mount the LinkStation SMB public share and copy the following files to it:
301
302    For LinkStation 1 / KuroBox standard
303    # mount -t smbfs -o password="" //<your_linkstation_name_or_ip>/share/mnt
304    # cp u-boot-hd.ram.bin /mnt
305    # cp ../uloader-2.4.17/uloader.o /mnt
306    # cp ../uloader-2.4.17/u-boot-load-hd.sh /mnt
307    # umount /mmt
308
309    For LinkStation HG / KuroBox HG
310    # mount -t smbfs -o password="" //<your_linkstation_name_or_ip>/share/mnt
311    # cp u-boot-hg.ram.bin /mnt
312    # cp ../uloader-2.4.20/uloader.o /mnt
313    # cp ../uloader-2.4.20/u-boot-load-hg.sh /mnt
314    # umount /mmt
315
316    If you installed the serial port, open another window and use minicom to
317    connect to your LinkStation serial console. The serial port settings are
318    57600,N,8, the same as the settings used by the original Linux kernel.
319
320    Start netcat to communicate with the U-Boot net console. Open another window
321    and run board/linkstation/nc.sh. Nc.sh is a simple script which invokes
322    netcat with the correct options. To quit nc, press ^T (control-T).
323    # cd $UBOOT_BUILD/u-boot-1.1.4
324    # board/linkstation/nc.sh <ip_of_your_linkstation>
325
326    Where <ip_of_your_linkstation> is CONFIG_IPADDR_LS (see Configure U-Boot
327    above). When you run nc.sh nothing will be written to the screen. This is
328    normal as Linux is not using the net console.
329
330    From your original window, use telnet to connect to the LinkStation and
331    launch U-Boot. Replace lshg in the example below with the name / IP address
332    of your LinkStation. Replace myroot with the login you created when you
333    gained  telnet  access.  For  LinkStation  1  /  KuroBox standard, use
334    u-boot-load-hd.sh instead of u-boot-load-hg.sh. Type the commands shown in
335    bold.
336    # telnet lshg
337    Trying 192.168.0.58...
338    Connected to lshg.
339    Escape character is '^]'.
340    BUFFALO INC. Link Station series HD-HGLAN (IEMITSU)
341    HD-HGLAN6C5 login: myroot
342    Linux (none) 2.4.20_mvl31-ppc_linkstation #3 Thu May 19 13:34:18 JST 2005
343    ppc unknown
344    root@HD-HGLAN6C5:~# cd /mnt/share
345    root@HD-HGLAN6C5:/mnt/share# ./u-boot-load-hg.sh
346    root@HD-HGLAN6C5:/mnt/share# exit
347    Connection closed by foreign host.
348    #
349
350    If you have a serial console you should see the initial U-Boot startup
351    messages. Even if the default console is the net console, U-Boot still sends
352    the console output to the serial port until it initialises the network
353    controller.
354    U-Boot 1.1.4 LiSt 2.1.0 (Sep 12 2006 - 23:09:44) LinkStation HG / KuroBox HG
355    CPU: MPC8245 Revision 1.4 at 262.144 MHz: 16 kB I-Cache 16 kB D-Cache
356    DRAM: 128 MB
357    FLASH: 4 MB
358    *** Warning - bad CRC, using default environment
359            00  0b  10ec  8169  0200  ff
360            00  0c  1283  8212  0180  ff
361            00  0e  1033  0035  0c03  ff
362            00  0e  1033  0035  0c03  ff
363            00  0e  1033  00e0  0c03  ff
364    Net:   RTL8169#0
365
366    Watch the net console window. After a few seconds, time needed by U-Boot to
367    initialise the network controller and the IDE controller you should see the
368    U-Boot messages.
369    U-Boot 1.1.4 LiSt 2.1.0 (Sep 12 2006 - 23:09:44) LinkStation HG / KuroBox HG
370    IDE:    Bus 0: OK
371      Device 0: Model: Maxtor 7Y250P0 Firm: YAR41BW0 Ser#: Y62W8PDE
372                Type: Hard Disk
373                Supports 48-bit addressing
374                Capacity: 239372.4 MB = 233.7 GB (490234752 x 512)
375    Boot in 10 seconds ('s' to stop)...
376
377    Press 's' on your keyboard to stop the boot process.
378
379    If  you  want  to  use the serial console, watch the power LED of your
380    LinkStation. When it starts blinking very slowly, use the power button to
381    stop the boot process. Wait for the power LED to go dim and press and hold
382    the power button until the LED lights up brightly indicating that the boot
383    process has stopped. Now press the reset button twice and you should see the
384    U-Boot command prompt (=>) in your minicom window. You can now control
385    U-Boot from the minicom window.
386
387    Using u-boot-load-hd.sh / u-boot-load-hg.sh leads to the above results on
388    devices with the original software. On some LinkStations with modified
389    software, reboot has been modified to send a reboot command to the AVR.
390    This is indicated by the fast blinking of the power LED immediately after
391    running u-boot-load-hd.sh / u-boot-load-hg.sh. Once the AVR receives a
392    reboot command, the reboot process cannot be stopped. The AVR will reboot
393    the LinkStation 5 min after receiving the reboot command.
394    If you find yourself in the above situation you can still test U-Boot by
395    booting your LinkStation with the AVR disabled. Press and hold the reset
396    button and then press the power button. All LEDs will start flashing but
397    your LinkStation will boot normally. Now you can use the procedure
398    described above with one caveat: the AVR being disabled, pressing the
399    buttons will have no effect so you will not be able to test the behaviour
400    of the minimal console. 
401
402    Once  you  get  the  U-Boot command prompt, start testing it. Read the
403    [15]U-Boot documentation and try each command you are interested in.
404
405    Keep in mind that U-Boot interprets all input number as hex numbers. If, for
406    example, you type 256, U-Boot will interpret it as 598 decimal.
407
408    When you are testing memory write commands, do not attempt to write to the
409    first MB of memory (0x00000000 to 0x00100000) as you will be overwriting the
410    exception vectors and U-Boot will crash.
411
412    An important command is flinfo which displays information about the flash
413    chip. If the information displayed is correct for your flash, test the flash
414    erase and flash write commands. To do this, you will need to find an empty
415    sector, one for which each byte is 0xFF. Hint: check the last flash sector
416    first, chances are that it's empty. When you are testing commands that write
417    to the flash, always remember that you can write a single byte but you can
418    only erase whole sectors.
419
420    Be very careful not to write to the flash memory range 0xFFC00000 to
421    0xFFF7FFFF. This area contains the Linux kernel, the initial RAM disk used
422    for EM mode, the bootloader and the configuration sector (which holds the
423    "OKOK" or "NGNG" pattern). The range 0xFFF80000 to 0xFFFFFFFF is the user
424    area and, in most cases, is empty. Always check using the U-Boot command md
425    (memory display) if the flash area you intend to use is empty (all bytes are
426    0xFF). For more information about the flash organisation, read
427    [16]PPCFlashROM for the LinkStation 1 / KuroBox standard or [17]HGFlashROM
428    for the LinkStation HG / KuroBox HG. 
429
430   ROM Build
431
432    Once you are happy with the RAM build, you are ready for the ROM build.
433
434    For LinkStation 1 / KuroBox standard run:
435    make linkstation_HDLAN_config
436    make linkstation_HDLAN
437
438    The name of the resulting binary is u-boot-hd.flash.bin
439
440    For LinkStation HG / KuroBox HG run:
441    make linkstation_HGLAN_config
442    make linkstation_HGLAN
443
444    The name of the resulting binary is u-boot-hg.flash.bin
445
446   Install
447
448    Do not attempt to flash from U-Boot if the power LED is blinking. Your
449    LinkStation is likely to reboot and you will end up with a "brick" 
450    Test the flash commands thoroughly before deciding to burn U-Boot into
451    flash. Write at least 128 kB to the flash to test potential timeout
452    problems 
453    The flash routines in this version of U-Boot for the LinkStation should be
454    able to identify and handle any CFI flash which uses the AMD standard
455    command set. However, they were tested only on a LinkStation with a Fujitsu
456    MBM29PL32TM flash chip and on a LinkStation HG with a ST Micro M29DW324DB
457    flash chip. 
458    Be very careful not to flash your hardware with the wrong U-Boot build.
459    Flashing any RAM build or flashing a ROM build for the LinkStation 1 /
460    KuroBox standard into the LinkStation HG / KuroBox HG or viceversa will
461    "brick" your device. This is especially true if you are flashing from Linux
462       as U-Boot has safety checks to avoid flashing the wrong build. 
463
464     Flashing U-Boot from U-Boot
465
466    The RAM build of U-Boot can be used to load and flash the ROM build. This is
467    the preferred method.
468
469    Boot your LinkStation normally. Open a telnet session and create a directory
470    to hold the U-Boot flash image.
471    root@linkstation:~# cd /mnt/share
472    root@linkstation:/mnt/share# mkdir u-boot
473
474    Copy the U-Boot flash image to your LinkStation SMB share in the directory
475    u-boot.
476
477    Load the RAM build of U-Boot and at the U-Boot command prompt type:
478    => run upgrade
479
480    U-Boot will attempt to load the ROM build from the directory share/u-boot/
481    on the third partition of the hard drive. If the load is successful, it will
482    do the following:
483     1. unprotect the bootloader area;
484     2. erase the bootloader area;
485     3. copy the loaded file to the bootloader area;
486     4. verify the copy;
487
488    Here is the output of run upgrade
489    => run upgrade
490    Loading 0:3:share/u-boot/u-boot-hg.flash.bin
491    174668 bytes read
492    Un-Protected 3 sectors
493    Flash erase: first = 55 @ 0xfff00000
494                 last  = 57 @ 0xfff20000
495    Flash erase: Done
496    Erased 3 sectors
497    Copy to Flash... done
498    Total of 174668 bytes were the same
499    =>
500
501    When the above sequence finishes, U-Boot returns to the command prompt (=>).
502
503    Depending on your flash chip, the flash operation can take a long time. Wait
504    patiently and do not try to power down or otherwise interrupt the flash or
505       you will end up with a "brick". 
506
507    Reboot:
508    => reset
509
510    The  power  LED should start blinking slowly and, if you have a serial
511    console, you should see the U-Boot startup messages. Your LinkStation is now
512    running U-Boot.
513
514     Flashing U-Boot from Linux
515
516    Connect to your LinkStation using either the serial port or telnet.
517
518    For LinkStation 1 / KuroBox standard run:
519    # cd /mnt/share/u-boot
520    # dd if=u-boot-hd.flash.bin of=/dev/fl2 bs=1k
521    # cmp u-boot.bin /dev/fl2
522
523    For LinkStation HG / KuroBox HG run:
524    # cd /mnt/share/u-boot
525    # dd if=u-boot-hg.flash.bin of=/dev/mtd1 bs=1k
526    # cmp u-boot.bin /dev/mtd1
527
528    The above commands for LinkStation HG / KuroBox HG will work on devices with
529    the original kernel version 2.4.20 but might to work on earlier devices
530    using kernel version 2.4.17. Please check which device corresponds to the
531    bootloader partition on your hardware.
532
533     If the Flash Fails
534
535    If the flash was not written correctly but U-Boot returns at the command
536    prompt, try to re-run run upgrade.
537
538    If the same happens when you attempt to install U-Boot from Linux, try to dd
539    again.
540
541    If your flash fails completely, for example due to a power failure, all is
542    not  completely  lost. You can still use a JTAG cable to re-flash your
543    Linkstation. Unfortunately, this is a relatively complicated and expensive
544    solution as it involves acquiring or building the JTAG cable and soldering
545    the header for it on the LinkStation motherboard. For more information on
546    how   to  use  a  JTAG  cable  with  the  LinkStation  you  can  visit
547    [18]www.linkstationwiki.net and [19]www.kurobox.com/mwiki.
548
549   EM Mode
550
551              Warning for the LinkStation / LinkStation HG users
552
553    Do not attempt to boot into EM mode using the method described here. The
554    password for the EM mode is unknown for all LinkStation models.
555
556    Once you have U-Boot installed in the on-board flash, you can boot in EM
557    mode even if the third boot command described above doesn't work.
558
559    Stop the boot countdown by pressing 's' in your net console window and, at
560    the U-Boot command prompt, run:
561    => run writeng
562    => run flboot
563
564    The above commands write "NGNG" to 0xFFF70000 and boot from the on-board
565    flash. To revert to normal boot by writing "OKOK" to 0xFFF70000, run:
566    => run writeok
567    => boot
568
569   Advanced configuration
570
571    The  initial  U-Boot  configuration can be changed by editing the file
572    include/configs/linkstation.h.
573
574    In all the examples below, please note the backslash-zero (\0) at the end of
575    the strings and the space-backslash ( \) at the end of each lines and do not
576    change them. 
577
578     Change the name of the default boot file
579
580    Search for the lines containing:
581    "hdpart=0:1\0" \
582    "hdfile=boot/vmlinux.UBoot\0" \
583
584    and  change  them  to the values you want. Partition 0:1 means disk 0,
585    partition 1. Obviously, you can only change the partition number as there is
586    only one disk. The name of the file must be given relative to the root of
587    the partition.
588
589     Change the default console to the serial console
590
591    Search for the lines containing:
592    "stdin=nc\0" \
593    "stdout=nc\0" \
594    "stderr=nc\0" \
595
596    and change them to:
597    "stdin=serial\0" \
598    "stdout=serial\0" \
599    "stderr=serial\0" \
600
601     Change the default boot command to boot from flash
602
603    Search for the lines containing:
604    "bootcmd1=run hdboot;run flboot\0" \
605    "bootcmd2=run flboot\0" \
606
607    and change them to:
608    "bootcmd1=run flboot\0" \
609    "bootcmd2=run hdboot;run flboot\0" \
610
611 References
612
613    1. http://www.linuxnotincluded.org.uk/fdl.txt
614    2. http://www.linkstationwiki.net/index.php?title=CGI_Exploit_%28PowerPC%29_original_method_of_Hacking_the_LinkStation
615    3. http://www.linkstationwiki.net/index.php?title=Turn_your_LinkStation_into_a_Kuro_Box_%28PowerPC%29
616    4. http://linkstationwiki.net/index.php?title=OpenLink
617    5. http://linkstationwiki.net/index.php?title=The_LinkStation_firmware_flasher
618    6. http://downloads.linkstationwiki.net/snapshots/HD-HGLAN_149_100_telnet.zip
619    7. http://www.linkstationwiki.net/index.php?title=Add_a_Serial_port_to_the_PowerPC_Linkstation
620    8. http://netcat.sourceforge.net/
621    9. http://www.vulnwatch.org/netcat
622   10. http://ftp.sunet.se/pub/Linux/distributions/eldk/3.1.1/ppc-linux-x86/iso/ppc-2005-03-07.iso
623   11. ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2
624   12. http://www.linuxnotincluded.org.uk/linkstation/downloads/u-boot-1.1.4-list-2.1.0.diff.gz
625   13. http://www.linuxnotincluded.org.uk/linkstation/downloads/uloader-2.4.17.tar.gz
626   14. http://www.linuxnotincluded.org.uk/linkstation/downloads/uloader-2.4.20.tar.gz
627   15. http://www.denx.de/wiki/DULG/Manual
628   16. http://linkstationwiki.net/index.php?title=Information/PPCFlashROM
629   17. http://linkstationwiki.net/index.php?title=Information/HGFlashROM
630   18. http://www.linkstationwiki.net/
631   19. http://www.kurobox.com/mwiki