/* See if there are 2 sticks. */ if((drb1 != 0) && (drb3 != 0)) {
Should be:
if((drb1 != 0) && (drb3 != drb1))
In theory this would not work. If you have a so-dimm in slot0 drb3 would == drb1. The register would look something like this:
04 04 04 04
for a 128MB single sidded so-dimm in the first slot.