Subject: Re: netboot via native bootloader
To: None <port-cobalt@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-cobalt
Date: 10/31/2007 00:51:51
I wrote:

> > Today I've been trying to add netboot support to the cobalt
> > native bootloader, using a standalone tulip (2114x Ethernet)
> > driver for sandpoint which has been committed by Tohru Nishimura:
>  :
> > Current my working sources are too ugly so I'll post
> > a patch after some more cleanup in a few days.
> 
> A patch to be committed is attached.

I've commited some more updated one.

I'm so lucky that the previous version happened to work
since I used a wrong value (16) for CACHELINESIZE in it.
Actually it should be 32 according to dmesg, but once
I changed the value from 16 to 32 bootloader stopped working.
There are still some DMA cache coherent issue around
cacheline boundaries.

I haven't still tracked what actually happens, but I have to
add a pad between TX desc and RX desc and make struct local
aligned at CACHELINESIZE (not sizeof struct desc) to avoid
shared cacheline between TX and RX descs otherwise RX won't
work correctly.

Furthermore, I also have to change tlp_send() to copy
data to txstore[] buffer allocated in struct local while
I have no idea why the previous one worked without it.
Wihtout this change, some short (~90 bytes) TX packets
seem corrupted. These packets have correct headers but
the NFS server doesn't respond such packets.

I also have to change tlp_recv() to set RPD_POLL bit
in the TLP_RPD register if no packets are received.
The previous patch already had it, but I'm not sure
if we really always have to enable RX.

Anyway, I've also put a newer binary here:
http://www.ceres.dti.ne.jp/~tsutsui/netbsd/boot-cobalt-20071030.gz

If you find any problem, please report it here or via send-pr(1).
---
Izumi Tsutsui