PLEASE REMOVE THIS PAGE CAUSE IT HAS BEEN MOVED TO http://www.elinux.org/Flameman

−

+

[[Category:ToDelete]]

−

'''please note''' this page is actively being updated, it is merged from the old version of wiki. so keep patient, i will rewrite this documentation as soon as possible

+

−

+

−

in case you need a pdf copy of the old doc, or if you need attachments feel free to ask me for them ( speeder@alice.it )

+

−

+

−

== Introduction ==

+

−

+

−

The Target-goal of this page is

+

−

* install gentoo-ppc32 into harddisk

+

−

* make the board able to boot from it

+

−

* describe how to build a jtag cable (to debug and recover from "Brickage")

+

−

* describe something useful with you can do with the board

+

−

* describe other Operating System avalaible for the board

+

−

+

−

+

−

logical steps about installing gentoo

+

−

* add the JTAG connector at J10 (you could skip it, it is suggested)

+

−

* build the JTAG cable (you could skip it, it is suggested))

+

−

* replace the bootloader with ppcboot 1.1.6/U-boot 1.1.4

+

−

* make partitions on the Hard Disk

+

−

* populate them

+

−

* set the bootloader environment to book from the Hard Disk

+

−

+

−

=== People you could contact if you need help ===

+

−

+

−

* people on irc freenode #edev #mklinux may be asked about

+

−

* flameman, i'm currently use this board for an university project running gentoo-ppc, email speeder@alice.it

+

−

* you ... if you want ;-)

+

−

+

−

----------------

+

−

+

−

i need to ask these people if they could be reported to be contacted

+

−

+

−

* dale-elinux@farnsworth.org

+

−

* GPSfan (irc freenode)

+

−

* Prpplague (irc freenode), Email: danders AT SPAMFREE amltd DOT com

+

−

+

−

=== About the board ===

+

−

+

−

DHT-Walnut is a shortened name for the Digital Home Technologies PCB 01070201 Rev. 1.1.

+

−

+

−

The DHT-Walnut board is based on the AMCC-Walnut (still available, and still expensive :P). It is a more improved board described at www.amcc.com.

+

−

+

−

A "walnut" searching will inform about schematic and software.

+

−

+

−

Also keep attention @ DENX: they have developed a lot for the AMCC-Walnut board, and you could find a linux patch for your problem, prettier documentation, developer suit, and much more: in case, you are suggested to have a look to their web pages.

+

−

+

−

+

−

you could find it on ebay, search for "walnut", or "powerpc"

+

−

+

−

+

−

MIND UP

+

−

the differences from "DHT WALNUT" and "AMCC WALNUT" ALSO CALLED "IBM WALNUT"

* '''LAN''' On-chip 405GP ethernet, board doesn't have an ethernet MAC address (the monitor/bootloader is able to fix it)

+

−

* '''UART''' DCE serial port, speeds up to 230k, only tested to 115200bps

+

−

* '''PCI''' two pci slots, keyed for 5V only cards

+

−

* '''IDE''' Promise Technologies PDC20265 IDE

+

−

* '''ROM''' 512k of boot flash, AMD 29LV040B (amd29lv040b.pdf), soldered on the PCB, if you like to use a socket you have to consider the bootloader will check for the flash manufactor ID, so or you replace the 29LV040B with an other socked-29LV040B, or you have to modify the bootloader

+

−

* '''POWER''' the board need to be 12v dc powered 2A max, it is able to feed the hard disk

+

−

* '''System PCB '''6.00" x 7.5" board size

+

−

* '''RTC''' the real time clock chip is missing

+

−

* '''RAM''' 32M PC133 SDRAM DIMM, the board has issues with more than 128M: if you inspect the pcb, you will see that the DIMM connector has same pin missing, this is the reason why you can't use DIMM bigger than 128M

+

−

* '''PCI IEEE-1394 card''' supported by OHCI driver

+

−

* '''PCI additional ethernet board''' needed cause the on board ethernet is implemented by the IBM-ppc-405GP, for example netbsd is not able to drive it, so in case you need an additional board, the one provided with DHT is good enough

+

−

* '''FIRMWARE''' PPCBoot v.1.1.2 in flash (it has issues with environment, it need to be replaced with a gooder one)

| PPC405GP, GPIO Open Drain register. Controls if pin is an open drain or active output.

+

−

|-

+

−

| 0xef60071c

+

−

| 0xef60071c+4

+

−

| PPC405GP, GPIO Input register. synchronized with OPBClk

+

−

|-

+

−

| 0xfff80000

+

−

| ???

+

−

| ???

+

−

|-

+

−

| 0xfffa0000

+

−

| 0xfffaffff

+

−

| flash, bootloader data

+

−

|-

+

−

| 0xfffb0000

+

−

| 0xfffbffff

+

−

| flash, bootloader data

+

−

|-

+

−

| 0xfffc0000

+

−

| 0xffffffff

+

−

| flash, bootloader

+

−

|-

+

−

| 0xfffffffc

+

−

| 0xfffffffc+4

+

−

| flash, PPC's boot from this location

+

−

|}

+

−

+

−

the u-boot image "sits" at the end of the flash, the 4xx PPC's boot from location 0xfffffffc, so the bootloader needs to be located at the end,

+

−

so if u-boot is 256kbyte then it is located 0xfffc0000 ... 0xffffffff

+

−

+

−

+

−

+

−

Open questions

+

−

--------------

+

−

how/where is ram mapped ?

+

−

+

−

how/where is harddisk mapped ?

+

−

+

−

how/where is pci mapped ?

+

−

+

−

what is the bootstrap addr of the flash ?

+

−

+

−

...

+

−

+

−

=== Problems ===

+

−

+

−

* uboot has issues in PCI/DMA initialization. More will be post in the future

+

−

<pre>

+

−

hi,

+

−

i found a problem using a pci sound card in the DHT-WALNUT.

+

−

It has been correctly recognized by the kernel, the DMA feature (ppc405-dma) is setted, but the card is not working.

+

−

+

−

somebody says it is a bug, somebody says ppcboot solves the problem inizializing the pci in the correct way. I don't know, i'm using the uboot v1.1.4 and it is not working

+

−

+

−

also have a look to this

+

−

+

−

<> but i already thought so when i saw the "pci long" output

+

−

<> no BAR was assigned with an address

+

−

<> this was different some time ago

+

−

<> could be something changed in the last few months in the common pci support

+

−

<> i'll check with an ex-kollegue and let you know

+

−

<> this will take till beginning of next week though

+

−

<> hey, i just checked the source (sometimes helpful)

+

−

<> you just need to enable the host bridge configuration via an env variable

+

−

<> => setenv pciconfighost yes

+

−

<> then

+

−

<> => saveenv

+

−

<> => reset

+

−

<> after this reset the BAR1 will be configured:

+

−

<> => pci long

+

−

<> Scanning PCI devices on bus 0

+

−

<> Found PCI device 00.00.00:

+

−

<> vendor ID = 0x1014

+

−

<> device ID = 0x0156

+

−

<> command register = 0x0006

+

−

<> status register = 0x2210

+

−

<> revision ID = 0x01

+

−

<> class code = 0x0b (Processor)

+

−

<> sub class code = 0x20

+

−

<> programming interface = 0x00

+

−

<> cache line = 0x00

+

−

<> latency time = 0x87

+

−

<> header type = 0x00

+

−

<> BIST = 0x00

+

−

<> base address 0 = 0x00000000

+

−

<> base address 1 = 0x80000008

+

−

+

−

could you help me to understand how to plug a soundcard ?

+

−

:)

+

−

</pre>

+

−

+

−

=== Images of the board ===

+

−

+

−

[[Image:dht-walnut-ppc405-board.jpg]]

+

−

+

−

see more detailed photo [[dht-walnut-ppc405-top]]

+

−

+

−

= JTAG =

+

−

+

−

The BEST solution is to equip your lab with the bdi2000. This hardware is expensive a lot, 'cause it is not a simple download cable, it's a professional debugger

+

−

+

−

For this dht-walnut project it has been used "OCD Commander is macraigor's free debugger software", that i'm going to illustrate

+

−

+

−

+

−

== JTAG & OCD Commander ==

+

−

The OCD Commander is macraigor's free debugger software, which allows you to connect to your supported target type chip via the On-Chip Debug port (BDM or JTAG) using a Macraigor hardware device. You will be able to test the connection, memory access, modify memory and registers, run code and more using this product. This debugger is not designed to be used to program flash devices connected to your target.

See How To build the JTAG Wiggle interface & add the JTAG connector at J10, Just in case you make a brick, you could fix the jam, using this procedure: JTAG Bootloader Installation

+

−

+

−

== JTAG add the J10 to the board ==

+

−

+

−

=== J10 ===

+

−

+

−

To add the J10 to the board suck or wick the solder out of the holes and solder it in, but be minded a common header has pins larger than holes, so ... be careful about what you do: you could damage the PCB

Using OCD Commander, a JTAG adapter, and GPSFan's ram resident ppcboot, it is possible to reprogram the flash. In short, use OCD Commander to turn on the sdram, download the ram targeted ppcboot, and install a new bootloader.

There's also an experimental ram-resident version of u-boot-1.1.4 attachment:u-boot-ram.s19 that can be downloaded to 0x400000. Source diffs against the current version from CVS, incorporating the patches from both GPSFan and dfarnsworth: attachment:u-boot-ram.patch . Expect to see much more output at boot, as this version has debug output turned on. (Other changes include setting the entry point in the linker script, output files renamed to u-boot.s19 and u-boot.elf, sdram config disabled, added debug info on code relocation, and a modified default environment.)

+

−

+

−

* Start OCD Commander, connect to the board, reset, and halt.

+

−

* reset

+

−

* The CPU should be ready to fetch the first instruction:

+

−

* cpu

+

−

* PC: FFFFFFFC CR: 00000000 MSR: 00000000 LR: 01FD327C

+

−

* B -524028

+

−

* Configure the system:

+

−

* recovery_config (Or hit the macro button and navigate to the recovery_config.mac file.)

Have a kernel Image and Userland Image in the /tftpboot/ directory on your server

+

−

=>tftpboot 400000 Working Kernel Image

+

−

< kernel image loads >

+

−

=>tftpboot c00000 Working Userland Image

+

−

< userland image loads >

+

−

bootm 400000 c00000

+

−

< kernel boots and loads userland image >

+

−

+

−

= HardDisk =

+

−

== what you need ==

+

−

updating ...

+

−

+

−

you need

+

−

* a PC running linux

+

−

* an empty harddisk of 2..4Gbyte

+

−

+

−

== idea ==

+

−

* put the dht-walnut harddisk into PC ide slot

+

−

* partition the harddisk

+

−

* install all the gentoo portages

+

−

* remove the harddisk and put it into dht-walnut ide slot

+

−

+

−

== partition ==

+

−

updting ...

+

−

== install ==

+

−

updating ..

+

−

+

−

= OS =

+

−

Operating System available for this board

+

−

+

−

== NetBSD ==

+

−

* [http://www.netbsd.org/Ports/evbppc/ Netbsd] has a port for "IBM PowerPC 405GP based Walnut evaluation board", this is not the DHT-Walnut, this is an other way to call the AMCC-Walnut (yes just to be confusing). Ok, it is not for DHT-Walnut, but this port could be (easealy / hardly) adapted to the DHT-Walnut with some work / over work

+

−

+

−

=== Hardware that is known to work with ===

+

−

* see netbsd web, the hw could be (easealy / hardly) adapted to the DHT-Walnut with some work / over work

ppcboot/U-Boot provides only basic functionality to access Hard disks: you can print the partition table and read and write blocks (addressed by absolute block number), but there is no support to create new partitions or to read files from any type of filesystem. The current version of ppcboot-1.1.6 has a problem with writing to hdd, however, once the Linux kernel is loaded and the userland initialized, the hdd can be accesses normally through PIO and DMA modes. This may or may-not be fixed in the future.

+

−

+

−

As usual, you can get some information about the available IDE commands using the help command in ppcboot:

You may create the needed partitions by tftpbooting Linux and an appropriate userland, then use fdisk to partition the disk. Then reboot back to ppcboot.

+

−

+

−

ppcboot can be configured for DOS and [[Mac OS]]? type partition tables. Since ppcboot cannot read files from a filesystem you should create one (or more) small partitions (maybe 1 or 2 MB) if you want to boot from the "disk". (The size of these partitions will depend on how large your kernel and userland images are)

+

−

+

−

You should create the following partiton table:

+

−

+

−

<pre> # fdisk /dev/hdx

+

−

hde: hdx1 hdx2 hdx3 hdx4

+

−

+

−

/dev/hde1 ID=83 Linux <---- 2Mb, boot kernel, dd if=kernel of=here

+

−

/dev/hde2 ID=83 Linux

+

−

/dev/hde3 ID=83 Linux <---- root & usr

+

−

/dev/hde4 ID=82 Swap <---- 32Mb, swap

+

−

+

−

You should also initialized /dev/hdx4 as swap space.

+

−

# mkswap /dev/hdx4

+

−

Setting up swapspace

+

−

+

−

check how ppcboot/U-Boot will recognize this partition table:

+

−

<pre> => ide part

+

−

+

−

* dd if=kernel.img of=/dev/hdx1

+

−

+

−

To boot from a disk you can use the diskboot command:

+

−

+

−

<pre> => help diskboot

+

−

diskboot loadAddr dev:part </pre>

+

−

+

−

The diskboot command expects a load address in RAM, and a combination of device and partition numbers, separated by a colon. It then reads the image from disk and stores it in memory. We can now boot it using the bootm command [to automatically boot the image define the ppcboot environment autostart with the value =yes=].

+

−

+

−

<pre> => diskboot 400000 0:1

+

−

ide_read dev 0 start 0, blocks 1 buffer at 3F9F8C0

+

−

## Valid DOS partition found ##

+

−

+

−

Loading from IDE device 0, partition 1: Name: hda1

+

−

Type: PPCBoot

+

−

First Block: 63, # of blocks: 8001, Block Size: 512

+

−

ide_read dev 0 start 3F, blocks 1 buffer at 400000

+

−

Image Name: DHT Kernel

+

−

..

+

−

+

−

=> bootm 400000 c00000

+

−

## Booting image at 00400000 ...

+

−

Image Name: DHT Walnut Kernel

+

−

Image Type: PowerPC Linux Kernel Image (gzip compressed)

+

−

... </pre>

+

−

+

−

+

−

<pre>=> setenv bootargs root=/dev/ram0

+

−

=> setenv autostart yes

+

−

=> disk 400000 0:1 \;\ diskboot c00000 0:2 \;\ bootm 400000 c00000

+

−

=> bootd

+

−

</pre>

+

−

(i will post all my setenv)

+

−

+

−

+

−

The above procedure puts the userland image from the second partition into a ramdisk. If you would like the userland to be an ext2/3/rieser/xfs partition on the hdd do the following:

+

−

+

−

* make the partiton table as above

+

−

* put the kernel and small userland onto the first partitions as above

* bootd to try out the new root, if it works ok, reboot back to ppcboot, change the bootargs again and saveenv

+

−

* bootd and enjoy your new system.

+

−

+

−

=== Hardware that is known to work with ===

+

−

There is a list of the Hardware that is known to work (and not to work) with this board. Feel free to add, comment, feedback about it.

+

−

+

−

* matrox millennium I/II

+

−

* 3com-netcard

+

−

* ...

+

−

+

−

=== Compile from sources ===

+

−

+

−

Linux 2.6 has issues in the source's tree: the dht-Walnut has been originally ported to arch=ppc, while the new kernel tree is around arch=powerpcc, for this reason you need to specify the right arch or your compiler will have issues. Developers will port everything to arch=powerppc in the future. Kernel 2.6.12 is free of this problem, newer than .12 have it.

+

−

+

−

=== Driver, Control the Green Media LED and J5 ===

+

−

+

−

==== Warning ====

+

−

The GPIO registers are quite fickle things. Not only are they for the Media LED and J5 header, they also manage the [[IRQs]] and Peripheral Chip selects. Hitting a wrong bit in Linux will cause problems, kernel panics, total lockups, bad things, 'plagues of locusts', you get the idea. When using the [[PPC405 _gpio]] driver below(or the 405_ocp_gpio driver in DENX [[Linux PPC]] 2.4, use a mask of 0xFFC00000, that way you don't manage to hit something you really don't want to.

+

−

+

−

==== Playing with the Media LED ====

+

−

The Media LED on the DHT-Walnut is wired to the processor by the GPIO pins. However its behind a 74VHC14 Schmitt Inverter. So you have to send it low in order to turn it on. This top section only covers the Media LED and the U-Boot/[[PPCBoot]] ROM Monitor.

+

−

+

−

==== Memory Locations ====

+

−

0xef600700 is the memory location of the GPIO output register. It's 4 bytes wide. It turns on and off the GPIO pins on the PPC405GP.

+

−

+

−

0xef600704 is the location of the Tri-State register. Also 4 bytes wide. Controls if the GPIO pin is active when high.

+

−

+

−

0xef600718 is the location of the Open Drain register. Also 4 bytes wide. Controls if the GPIO pin is an open drain or active output.

+

−

+

−

0xef60071c is the location of the GPIO Input register. Also 4 bytes wide. The state of each pin is reflected in the correspondig value in this register. (synchronized with [[OPBClk]])

+

−

+

−

==== Playing with the LED ====

+

−

By having all the bits in the Tri-State register high and the Output register all low, The pins are driven low. Because the Media LED is behind the inverter it glows when low. Setting it high in the Output register will turn it off.

+

−

+

−

===== Example using U-Boot 1.1.4 =====

+

−

Setting the Tri-State Register to drive all usable GPIOs.

+

−

<pre>=> nm 0xef600704

+

−

ef600704: 00000000 ? ffc00000

+

−

ef600704: ffc00000 ?</pre>

+

−

The LED should be lit now as its pin is driven low.

+

−

+

−

+

−

Turning the LED on and off with the Output Register

+

−

<pre>=> nm 0xef600700

+

−

ef600700: 00000000 ? 20000000 //LED should be off.

+

−

ef600700: 20000000 ? 00000000 //LED goes on.

+

−

ef600700: 00000000 ?</pre>

+

−

+

−

==== The J5 Header ====

+

−

The J5 header located to the left of the RAM slot actually has 9 GPIO pins wired to it. [[GPIOs]] 1 to 9 to be exact. That header also has the Power and Media [[LEDs]] wired to it, so using the first 2 pins will look awkward if your bit-banging to say a SD/MMC card or LCD display. The J5 header has the following layout. As things are developed they will be added.

+

−

+

−

[[Image:dht-walnut-ppc405-gpio-J5.jpg]]

+

−

+

−

{| border="1" cellspacing="0" cellpadding="5" align="center"

+

−

! pin

+

−

! addr

+

−

! function

+

−

|-

+

−

|GPIO1

+

−

|0x400

+

−

|POWERLED

+

−

|-

+

−

|GPIO2

+

−

|0x200

+

−

|MEDIALED

+

−

|-

+

−

|GPIO3

+

−

|0x100

+

−

|I/O

+

−

|-

+

−

|GPIO4

+

−

|0x080

+

−

|I/O

+

−

|-

+

−

|GPIO5

+

−

|0x040

+

−

|I/O

+

−

|-

+

−

|GPIO6

+

−

|0x020

+

−

|I/O

+

−

|-

+

−

|GPIO7

+

−

|0x010

+

−

|I/O

+

−

|-

+

−

|GPIO8

+

−

|0x008

+

−

|I/O

+

−

|-

+

−

|GPIO9

+

−

|none

+

−

|GND

+

−

|-

+

−

|}

+

−

+

−

==== Linux and the GPIOs ====

+

−

===== Module for 2.6.16 =====

+

−

Using a module from a Monta Vista 2.4 kernel, I did the slight editing so that it will compile with 2.6.16. I have made a patch file that can be applied to a vanilla 2.6.16 kernel.

+

−

+

−

Also included is a small bit of test code to show how to operate the gpio driver.

+

−

+

−

Module patch and test code here: [[Media:ppc405_gpio.tar.gz]]

+

−

+

−

(Version 2 will be up once I clean some little problems out of the test code, possibly tonight)

+

−

+

−

Any errors or things you want to see, don't hesitate to let me know. I'll be slowly adding little things to the module as helpers.

+

−

+

−

Once you have your module installed and modprobe/insmoded, just run 'make' to built the test app. If you don't have a /dev/ entry yet just 'make dev' and it'll do it for you. DevFS isn't supported yet, I'm working on that now.

+

−

+

−

= Project: do something useful with the board =

+

−

+

−

== DHT-Walnut as N.A.S. ==

+

−

[[Image:dht-walnut-ppc405-nas-mini.jpg]]

+

−

+

−

I turned a DHT-Walnut + 300Gb hard disk into a file server to have my data files connected and shared to the LAN (Local Area Network).

+

−

+

−

N.A.S. stands for Network Attached Storage. They are storage devices attached to the lan. A NAS should be able to be connected to every kind of network. It should use both the access protocols NFS (Network File System) and CIFS (Common Internet File System)

+

−

+

−

I only enabled NFS service in the kernel configure because i don't need CIFS. UNIX servers use NFS, while Microsoft systems use CIFS, fortunately i don't have any Microsoft systems here :P Gentoo is installed in the first little partition of the hard disk (it is PC-partition style, so you can only have 4 partitions). It runs openssh, telnet, ftp, tftp, and NFS. As the fact there is no RTC chip installed i added special /etc/init.d/clock-sync to set the local time. The scrips uses rdata to retrieve the current time of an other machine.

+

−

+

−

In the photo you could see the case i realized: the hard drive is connected to the opened door, the DHT-walnut PCD has been placed inside, the green LED has been used to the frontal case to say "the booting has been completed, the system is ready" (used the gpio hack provided in patches for the 2.6.16-rc3). The black platform is from sony playstation2 and is is only a nice way to have the case vertically seated.

+

−

+

−

Don't keep about the ALS4000 pci sound board plugged in the upper PCI bus. It has been plugged just to use the NAS as the giant (300Gb) ipod you have ever seen .... but this is an other story ....

+

−

+

−

== DHT-Walnut as MP3-player ==

+

−

Following in the footsteps of [http://devices.natetrue.com/musicap/ Nate True], I turned a DHT-Walnut + parts into a server to play my music collection. It grabs the data via nfs from an [http://www.nslu2-linux.org/ NSLU2], and is controlled via various [http://www.musicpd.org/clients.shtml mpc-like] clients from my desktops.

+

−

+

−

[http://www.musicpd.org/ mpd] server

+

−

+

−

[[Image:dht-walnut-ppc405-mpd-server.jpg]]

+

−

+

−

After the above was running flawlessly for a day, somehow the usb audio device got fried. May have been a ground loop in the stereo. I had gotten used to having music playing. so I dug out an old PCI sound card (CS4280 based) and compiled the drivers and plugged it in. GIGO... seems like IBM4xx DMA support needs to be turned on in the kernel to make it work. Things are fine now with a few extra ground wires, just to be sure.

+

−

+

−

'''Note:''' to use a PCI-sound card you need to use ppcboot. U-boot-1.1.6 has an issue with kernel initialization. It is under fixing, but today it causes the DMA not to work correctly with the sound card. No sound at all.