Annotation of wikisrc/ports/sandpoint/inststorcenter.mdwn, revision 1.5

1.1       mspo        1: Introduction
                      2: ============
                      3: 
                      4: <table>
                      5: <tbody>
                      6: <tr class="odd">
1.2       phx         7: <td align="left"><p>This document describes in depth how to prepare your Iomega StorCenter G2 for installing NetBSD/sandpoint. The three supported models are:</p>
1.1       mspo        8: <ul>
                      9: <li>StorCenter G2 Single Drive, 200MHz</li>
                     10: <li>StorCenter G2 Dual Drive, 200MHz</li>
                     11: <li>StorCenter G2 Quad Drive, 266MHz</li>
                     12: </ul>
                     13: <p>All models have 64 MB RAM and a PATA disk interface. Note that newer StorCenter models use an ARM CPU and are not supported.</p>
1.2       phx        14: <p>To install NetBSD/sandpoint you will have to open the case for getting access to the serial console. This is shown here for the Single Drive model.</p></td>
1.5     ! phx        15: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_portrait.jpg" alt="StorCenter Single Drive" /></td>
1.1       mspo       16: </tr>
                     17: </tbody>
                     18: </table>
                     19: 
                     20: Accessing the serial interface
                     21: ==============================
                     22: 
                     23: We need a serial console to get access to the firmware. That includes
                     24: soldering a cable to the board and building (or buying) a serial adapter
                     25: to convert from the StorCenter's TTL levels to RS232 levels.
                     26: 
                     27: Disassemble the StorCenter Single Drive
                     28: ---------------------------------------
                     29: 
                     30: <table>
                     31: <tbody>
                     32: <tr class="odd">
1.5     ! phx        33: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open1.jpg" alt="StorCenter disassembly step 1" /></td>
1.1       mspo       34: <td align="left"><p>The Single Drive model is somewhat tricky to open. Move the cover by applying some force into the direction away from the interface bezel. It will eventually snap open. Then remove the metal shielding. Again, there are no screws. It is held in place by some brackets. Just pull it upwards and you will see the hard disk.</p></td>
1.5     ! phx        35: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open2.jpg" alt="StorCenter disassembly step 2" /></td>
1.1       mspo       36: </tr>
                     37: </tbody>
                     38: </table>
                     39: 
                     40: <table>
                     41: <tbody>
                     42: <tr class="odd">
1.5     ! phx        43: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open3.jpg" alt="StorCenter disassembly step 3" /></td>
1.1       mspo       44: <td align="left"><p>Do not try to access the screws, which are securing the disk drive, through the plastic vents. To be able to pull the metal case up we have to remove four screws at the bottom first, which are hidden behind a plastic plate. Pry open the plastic plate using a levering tool, like a screw driver. You will need some force to do that.</p></td>
                     45: </tr>
                     46: </tbody>
                     47: </table>
                     48: 
                     49: <table>
                     50: <tbody>
                     51: <tr class="odd">
1.5     ! phx        52: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open4.jpg" alt="StorCenter disassembly step 4" /></td>
1.1       mspo       53: <td align="left"><p>Remove the four screws at the bottom. Now you can easily pull the metal case out.</p></td>
1.5     ! phx        54: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open5.jpg" alt="StorCenter disassembly step 5" /></td>
1.1       mspo       55: </tr>
                     56: </tbody>
                     57: </table>
                     58: 
                     59: <table>
                     60: <tbody>
                     61: <tr class="odd">
1.5     ! phx        62: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_open6.jpg" alt="StorCenter disassembly step 6" /></td>
1.1       mspo       63: <td align="left"><p>Remove the four screws which are securing the hard disk and unplug its connectors. Also remove the fan and the LED from the metal case. Now you can pull the mainboard out of the metal case, by moving it into the direction of the rear bezel.</p></td>
                     64: </tr>
                     65: </tbody>
                     66: </table>
                     67: 
                     68: Locate the serial header
                     69: ------------------------
                     70: 
                     71: Look out for an unpopulated 8-pin header, called `J11` (marked red on
                     72: the picture to the left). The leftmost four pins can be used for the
                     73: serial interface. The pin assignments are shown in the table.
                     74: 
                     75: <table>
                     76: <tbody>
                     77: <tr class="odd">
1.5     ! phx        78: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_board.jpg" alt="StorCenter mainboard" /></td>
1.1       mspo       79: <td align="left"><table>
                     80: <tbody>
                     81: <tr class="odd">
                     82: <td align="left"><strong>Pin number</strong></td>
                     83: <td align="left"><strong>Function</strong></td>
                     84: </tr>
                     85: <tr class="even">
                     86: <td align="left">1</td>
                     87: <td align="left">3.3V</td>
                     88: </tr>
                     89: <tr class="odd">
                     90: <td align="left">2</td>
                     91: <td align="left">TXD</td>
                     92: </tr>
                     93: <tr class="even">
                     94: <td align="left">3</td>
                     95: <td align="left">GND</td>
                     96: </tr>
                     97: <tr class="odd">
                     98: <td align="left">4</td>
                     99: <td align="left">RXD</td>
                    100: </tr>
                    101: </tbody>
                    102: </table></td>
1.5     ! phx       103: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_ser_header.jpg" alt="Header pin assignments" /></td>
1.1       mspo      104: </tr>
                    105: </tbody>
                    106: </table>
                    107: 
                    108: Attaching a serial cable
                    109: ------------------------
                    110: 
                    111: <table>
                    112: <tbody>
                    113: <tr class="odd">
                    114: <td align="left"><p>It is not recommended to solder a header onto <code>J11</code>, because then you would no longer be able to close the case. Instead you should just solder a 4-wire ribbon cable, which is flat enough to hide under the disk drive. Also make sure to choose a small 4-pin plug, which you can connect to your external cable with the actual D-SUB 9 connector. Alternatively you can cut a hole into the case.</p></td>
1.5     ! phx       115: <td align="left"><img src="http://www.NetBSD.org/images/ports/sandpoint/iomega_ser_cable.jpg" alt="StorCenter serial cable attached" /></td>
1.1       mspo      116: </tr>
                    117: </tbody>
                    118: </table>
                    119: 
                    120: Serial connection
                    121: -----------------
                    122: 
                    123: The serial port on the StorCenter is using 3.3V TTL levels, which have
                    124: to be converted into regular RS232 levels by a level shifter circuit. If
                    125: you are not anxious using a soldering iron you find detailed
                    126: instructions how to build such a converter here:
                    127: 
1.5     ! phx       128: -   [Serial adapter for 3.3V TTL](http://www.NetBSD.org/ports/sandpoint/ttl2rs232.html)
1.1       mspo      129: 
                    130: Make sure that the layout of the plug fits to the pinout of the
                    131: StorCenter's serial header, as shown above.
                    132: 
                    133: Another option is to buy such a converter. There are solutions for a
                    134: standard RS232 interface and for an USB interface. Look out for:
                    135: 
                    136: -   RS232 level shifter / breakout board (MAX3232 based)
                    137: -   USB to TLL serial level shifter / breakout board (FT232 based)
                    138: 
                    139: First installation
                    140: ==================
                    141: 
                    142: Accessing the Firmware
                    143: ----------------------
                    144: 
                    145: Provided the serial converter is installed and working correctly you
                    146: should be able to connect to the firmware's serial console. Iomega is
                    147: using [U-Boot](http://www.denx.de/wiki/U-Boot/), the Universal Boot
                    148: Loader.
                    149: 
                    150: Now you can connect with any terminal program to the StorCenter's serial
1.2       phx       151: console. The easiest approach may be to use NetBSD's `tip(1)` command to
1.1       mspo      152: make a direct console connection at 115200bps.
                    153: 
                    154:     # tip -115200 console
                    155: 
                    156: Note that when using a serial connection via USB you may have to make an
                    157: entry for `/dev/ttyU0` in `/etc/remote`.
                    158: 
                    159: Immediately after switching your StorCenter on it will display the
                    160: following information (output is from a Single Drive model) and gives
                    161: you one second to stop autobooting.
                    162: 
                    163:     U-Boot 1.0.0 (Sep  2 2005 - 14:49:11)
                    164: 
                    165:     CPU:   MPC8241 Revision 1.4 at 199.999 MHz: 16 kB I-Cache 16 kB D-Cache
                    166:     Board: StorCenter
                    167:     PICR1 is now 00141b98
                    168:     PICR2 is now 00040605
                    169:     AMBOR is now c1
                    170:     DRAM:  64 MB   
                    171:     FLASH:  8 MB   
                    172:     In:    serial  
                    173:     Out:   serial
                    174:     Err:   serial
                    175:     Net:   PCI device RTL8169#0: unknown chip version, assuming RTL-8169
                    176:     PCI device: TxConfig = 0x0
                    177:     RTL8169#0
                    178:     Hit any key to stop autoboot:  0
                    179: 
                    180: altboot
                    181: -------
                    182: 
                    183: The `altboot(8)` utility functions as a bridge between the Iomega
1.2       phx       184: firmware and the NetBSD kernel startup environment. NAS firmware often
1.1       mspo      185: provides no means to boot a kernel from disk or from the network and
                    186: doesn't initialize all hardware correctly. We will also use it to pass a
                    187: bootinfo list to the kernel.
                    188: 
                    189: The `altboot` boot loader has to be loaded and started using U-Boot.
                    190: Usually there are three ways to invoke it:
                    191: 
1.4       phx       192: -   **loadb** to load a binary file via serial line in kermit mode
                    193: -   **tftpboot** to load a binary file over the network with TFTP protocol
1.1       mspo      194: -   start it from the flash memory
                    195: 
                    196: The last option is prefered once the installation is completed, but
                    197: obviously it is not possible for the first time boot. Fortunately U-Boot
                    198: has set up the network interface, which we can use after configuring the
                    199: `ipaddr` and `serverip` environment variables:
                    200: 
1.4       phx       201: <pre>
                    202: IOMEGA=&gt; <strong>setenv ipaddr 192.168.0.105</strong>
                    203: IOMEGA=&gt; <strong>setenv serverip 192.168.0.5</strong>
                    204: IOMEGA=&gt; <strong>saveenv</strong>
                    205: Saving Environment to Flash...
                    206: Un-Protected 1 sectors
                    207: Erasing Flash...
                    208: . done
                    209: Erased 1 sectors
                    210: Writing to Flash... done
                    211: Protected 1 sectors
                    212: </pre>
1.1       mspo      213: 
                    214: Once you have set up TFTP and DHCP ([read below](#altboot_install)) you
                    215: can download `altboot` like this:
                    216: 
1.4       phx       217: <pre>
                    218: IOMEGA=&gt; <strong>tftp 1000000 altboot.bin</strong>
                    219: TFTP from server 192.168.0.5; our IP address is 192.168.0.105
                    220: Filename 'altboot.bin'.
                    221: Load address: 0x1000000
                    222: Loading: ###############
                    223: done
                    224: Bytes transferred = 74732 (123ec hex)
                    225: </pre>
1.1       mspo      226: 
1.5     ! phx       227: <a name="altboot_install"></a>
1.1       mspo      228: Boot the INSTALL kernel with altboot
                    229: ------------------------------------
                    230: 
                    231: Now you can use `altboot` to launch the `netbsd-INSTALL` kernel for
1.2       phx       232: installing NetBSD. You may choose to load it with TFTP or from NFS. For TFTP
1.1       mspo      233: you have to enable `tftpd(8)` in `/etc/inetd.conf`, and for NFS there is
                    234: a documentation at [The Network File
1.5     ! phx       235: System](http://www.NetBSD.org/docs/guide/en/chap-net-services.html#chap-net-services-nfs).
1.1       mspo      236: But in both cases you have to set up a DHCP server, which is explained
1.5     ! phx       237: in the [DHCP Howto](http://www.NetBSD.org/docs/network/dhcp.html). An
1.1       mspo      238: appropriate `dhcpd.conf` entry could look like this:
                    239: 
                    240:             host storcenter {
                    241:                     hardware ethernet 00:d0:b8:xx:xx:xx;
                    242:                     fixed-address 192.168.0.105;
                    243:                     next-server 192.168.0.5;
                    244:                     option root-path "/export/storcenter/root";
                    245:             }
                    246: 
                    247: The `root-path` option is only needed when using NFS and should match
                    248: your exported NFS directory. Uncompress `netbsd-INSTALL.gz` from the
1.2       phx       249: NetBSD/sandpoint distribution and copy it into the NFS or TFTP directory.
1.1       mspo      250: Then start the DHCP, NFS or TFTP server and boot the installation kernel
                    251: from the firmware either with
                    252: 
1.4       phx       253: <pre>
                    254: IOMEGA=&gt; <strong>go 1000000 tftp:netbsd-INSTALL</strong>
                    255: </pre>
1.1       mspo      256: 
                    257: or from NFS:
                    258: 
1.4       phx       259: <pre>
                    260: IOMEGA=&gt; <strong>go 1000000 nfs:netbsd-INSTALL</strong>
                    261: </pre>
1.1       mspo      262: 
                    263: Our bootloader configures the hardware, determines the IP address, loads
                    264: the kernel via network and launches it:
                    265: 
                    266:     ## Starting application at 0x01000000 ...
                    267: 
1.2       phx       268:     >> NetBSD/sandpoint altboot, revision 1.8 (Wed Nov 23 21:51:40 CET 2011)
1.1       mspo      269:     >> IOMEGA StorCenter G2, cpu 200 MHz, bus 100 MHz, 64MB SDRAM
                    270:     channel 0 present
                    271:     wd0: <ST3300822A> DMA LBA LBA48 286168 MB
                    272:     wd0: no disklabel
                    273:     MAC address 00:d0:b8:xx:xx:xx
                    274:     100Mbps-FDX
                    275:     Hit any key to enter interactive mode: 0
                    276:     loading "netbsd-INSTALL" 5222228+112540=0x516b78
                    277:     entry=0x90000, ssym=0x5a66f0, esym=0x5a6b78
                    278:     Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
                    279:         2006, 2007, 2008, 2009, 2010, 2011
1.2       phx       280:         The NetBSD Foundation, Inc.  All rights reserved.
1.1       mspo      281:     Copyright (c) 1982, 1986, 1989, 1991, 1993
                    282:         The Regents of the University of California.  All rights reserved.
                    283: 
1.2       phx       284:     NetBSD 5.99.59 (INSTALL) #10: Fri Dec 30 18:53:09 CET 2011
1.1       mspo      285:         frank@compaq.owl.de:/home/frank/netbsd/current/src/sys/arch/sandpoint/compile/obj/INSTALL
                    286:     Model: iomega
                    287:     total memory = 65536 KB
                    288:     avail memory = 57904 KB
                    289:     OpenPIC Version 1.2: Supports 1 CPUs and 26 interrupt sources.
                    290:     mainbus0 (root)
                    291:     cpu0 at mainbus0: 8245 (Revision 0.4), ID 0 (primary)
                    292:     cpu0: HID0 0x90c000<DOZE,DPM,ICE,DCE>, powersave: 1
                    293:     eumb0 at mainbus0
                    294:     com0 at eumb0 unit 0: ns16550a, working fifo
                    295:     com0: console
                    296:     com0: interrupting at irq 40
                    297:     ociic0 at eumb0
                    298:     iic0 at ociic0: I2C bus
                    299:     dsrtc0 at iic0 addr 0x68: DS1307 Real-time Clock/NVRAM
                    300:     satmgr0 at eumb0 unit 1: button manager (iomega)
                    301:     satmgr0: interrupting at irq 41
                    302:     pci0 at mainbus0 bus 0
                    303:     pchb0 at pci0 dev 0 function 0
                    304:     pchb0: vendor 0x1057 product 0x0006 (rev. 0x14)
                    305:     viaide0 at pci0 dev 13 function 0
                    306:     viaide0: VIA Technologies VT6410 IDE controller
                    307:     viaide0: using irq 17 for native-PCI interrupt
                    308:     atabus0 at viaide0 channel 0
                    309:     atabus1 at viaide0 channel 1
                    310:     ohci0 at pci0 dev 14 function 0: vendor 0x1033 product 0x0035 (rev. 0x43)
                    311:     ohci0: interrupting at irq 18
                    312:     ohci0: OHCI version 1.0
                    313:     usb0 at ohci0: USB revision 1.0
                    314:     ohci1 at pci0 dev 14 function 1: vendor 0x1033 product 0x0035 (rev. 0x43)
                    315:     ohci1: interrupting at irq 19
                    316:     ohci1: OHCI version 1.0
                    317:     usb1 at ohci1: USB revision 1.0
                    318:     ehci0 at pci0 dev 14 function 2: vendor 0x1033 product 0x00e0 (rev. 0x04)
                    319:     ehci0: interrupting at irq 20
                    320:     ehci0: companion controllers, 3 ports each: ohci0 ohci1
                    321:     usb2 at ehci0: USB revision 2.0
                    322:     re0 at pci0 dev 15 function 0: RealTek 8169/8110 Gigabit Ethernet (rev. 0x10)
                    323:     re0: interrupting at irq 16
                    324:     re0: Ethernet address 00:d0:b8:xx:xx:xx
                    325:     rgephy0 at re0 phy 7: RTL8169S/8110S/8211 1000BASE-T media interface, rev. 3
                    326:     rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
                    327:     biomask 1f000000 netmask 1f000000 ttymask 1f000000
                    328:     uhub0 at usb0: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    329:     uhub1 at usb1: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    330:     uhub2 at usb2: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
                    331:     wd0 at atabus0 drive 0
                    332:     wd0: <ST3300822A>
                    333:     wd0: 279 GB, 581421 cyl, 16 head, 63 sec, 512 bytes/sect x 586072368 sectors
                    334:     boot device: re0
                    335:     root on md0a dumps on md0b
                    336:     root file system type: ffs
                    337:     WARNING: preposterous TOD clock time
                    338:     WARNING: using filesystem time
                    339:     WARNING: CHECK AND RESET THE DATE!
                    340:     erase ^H, werase ^W, kill ^U, intr ^C, status ^T
                    341:     Terminal type? [vt100]
                    342: 
1.2       phx       343: Just follow the usual procedure to install a NetBSD system.
1.1       mspo      344: 
1.5     ! phx       345: <img src="//www.NetBSD.org/images/ports/sandpoint/install_window.jpg" alt="Sandpoint installation window" /></td>
1.4       phx       346: 
1.1       mspo      347: Post installation steps
                    348: =======================
                    349: 
                    350: After a successful installation you want to make the system boot
                    351: standalone when switched on, without the need for a serial console. So
                    352: you have to modify the `bootcmd` in U-Boot's environment and write the
                    353: `altboot.bin` binary to the Flash ROM.
                    354: 
1.4       phx       355: To find a suitable place in the Flash ROM you can use the **flinfo**
1.1       mspo      356: command and look out for empty sectors `(E)`. On my StorCenter I have
                    357: chosen `0xffe80000`. Replace that in all the following commands if you
                    358: have chosen a different address.
                    359: 
                    360: Load `altboot.bin` into memory at `0x1000000` again, as explained above.
                    361: Then execute the following commands to write it to Flash ROM:
                    362: 
1.4       phx       363: <pre>
                    364: IOMEGA=&gt; <strong>protect off ffe80000 ffe9ffff</strong>
                    365: Un-Protected 2 sectors
                    366: IOMEGA=&gt; <strong>erase ffe80000 ffe9ffff</strong>
                    367: 
                    368: . done
                    369: Erased 2 sectors
                    370: IOMEGA=&gt; <strong>cp.b 1000000 ffe80000 18000</strong>
                    371: Copy to Flash... done
                    372: IOMEGA=&gt; <strong>protect on ffe80000 ffe9ffff</strong>
                    373: Protected 2 sectors
                    374: </pre>
1.1       mspo      375: 
                    376: Finally adapt the `bootcmd` environment string to autoboot `altboot` and
                    377: start the `netbsd` kernel (which is the default name) from `wd0` on each
                    378: reboot:
                    379: 
1.4       phx       380: <pre>
                    381: IOMEGA=&gt; <strong>setenv bootcmd cp.b ffe80000 1000000 18000\; go 1000000 wd0:</strong>
                    382: IOMEGA=&gt; <strong>saveenv</strong>
                    383: Saving Environment to Flash...
                    384: Un-Protected 1 sectors
                    385: Erasing Flash...
                    386: . done
                    387: Erased 1 sectors
                    388: Writing to Flash... done
                    389: Protected 1 sectors
                    390: </pre>
1.1       mspo      391: 
1.4       phx       392: The `\` is important for **setenv** not to misinterpret the `;` as the end
1.1       mspo      393: of the command.
                    394: 
1.2       phx       395: Have fun with your mini NetBSD server!

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb