Porting FreeBSD-S3c2410 - Root file system
Andrew Turner
andrew at fubar.geek.nz
Wed Jun 30 03:00:44 UTC 2010
On Wed, 30 Jun 2010 07:40:58 +0700
Ho Van Than <hvanthan at gmail.com> wrote:
> Hi,
>
> I patched dm9000 to source code and compiled ok but still not yet
> success. I have a question at booting time "dm9000" auto run with
> kernel or we have to manual run it. (sorry I am newbie in FreeBSD).
The patch only provides the driver. It doesn't contain the changes
required to attach the driver to the rest of the system as it depends
on how the chip is attached to the micro. Assuming it is connected to
the memory bus you should only need to (within sys/arm/s3c2xx0):
* Edit s3c24x0_machdep.c to add an entry to s3c24x0_devmap. You should
be able to copy one of the other entries and change the first three
fields (virtual address, physical address and size). Set the virtual
address to something free in the kernel space (above 0xc0000000).
0xe8000000 should work. The physical address is the address the
DM9000 is attached to, this will depend on which chip select it is
attached to. The size is the size of the register space on the
DM9000, 0x100.
* Edit s3c24x0.c and add to s3c24x0_attach a call bus_space_map. You
will need to give it the physical address and size from above. You
can create the handle for the last argument for this look in
s3c2xx0var.h at the _ioh entries in struct s3c2xx0_softc.
* In the same function add the following just before the call to
bus_space_probe:
child = s3c24x0_add_child(dev, 0, "dme", 0);
bus_set_resource(child, SYS_RES_MEMORY, 0, <virtual address>, 0x100);
Change the virtual address to what you set it to in the first step.
I've been working on simplifying this process but haven't finished it
yet.
Andrew
--
Andrew Turner
WhiteQueue Consulting http://whitequeue.com/
Custom FreeBSD and Linux development
More information about the freebsd-arm
mailing list