FreeBSD/powerpc on PPCBug-based embedded boards

Peter Grehan grehan at freebsd.org
Fri Jan 30 14:49:05 PST 2004


Hi Rafal,

> here is some early boot log (for the evidence:)

  Excellent ! :-)

> ravenpic0: <Raven MPIC interrupt controller> on nexus0
> ravenpic0: Version 1.3, supports 2 CPUs and 16 irqs

  I've done some major surgery on the OpenPIC code so that
the register don't have to be touched at nexus probe time.
You might want to check that out. The driver will be a little
obtuse since it needs both a nexus attachment and also
a h/w bus attachment, but there's examples in the ofw openpic
and the psim iobus openpic.

> pci0: <bridge, PCI-ISA> at device 11.0 (no driver attached)

  Are there many ISA peripherals on this device ? The ISA bus
is a bit difficult to handle on PPC.

> pci0: <mass storage, ATA> at device 11.1 (no driver attached)

  PCI ATA should work fine, so long as you handle i/o mapping in
your PCI bridge code. I haven't done it yet in UniNorth, but the
Grackle code has an example that has been tested with PCI/ATA
controllers.

> pci0: <serial bus, USB> at device 11.2 (no driver attached)

  USB works great, you should add it to your config file if this is
OHCI.

> pci0: <old, non-VGA display device> at device 11.3 (no driver attached)

  If OpenFirmware sets this up in fb8 mode, the ofw framebuffer console
will work on this, with maybe some tweaking in the probe code.
But, if it's just a VGA card plugged into a PCI slot, you're out
of luck.

> de0: <Digital 21140A Fast Ethernet> port 0xfffff00-0xfffff7f mem
> 0x3bffff00-0x3bffff7f irq 10 at device 14.0 on pci0
> de0: 21140A [10-100Mb/s] pass 2.2
> de0: address 00:01:af:01:48:b7

  Does this work OK ? If so, I'll add it to GENERIC.

> Manual root filesystem specification:
>   <fstype>:<device>  Mount <device> using filesystem <fstype>
>                        eg. ufs:/dev/da0a
>   ?                  List valid disk boot devices
>   <empty line>       Abort manual input
> 
> mountroot>

  During early phases of development, I often use CD9660 mem disks.
At the loader prompt, it's "> load -t md_image iso.img"m, and then
at the mountroot> prompt, "cd9660:md0", or set vfs.root.mountfrom
at the loader prompt.

  However, it does require a minor change to vfs_mount.c to allow
a r/o ramdisk to be mounted as root. Patch appended.

later,

Peter.

diff -u -r1.115 vfs_mount.c
--- vfs_mount.c 14 Nov 2003 05:27:41 -0000      1.115
+++ vfs_mount.c 23 Nov 2003 11:25:23 -0000
@@ -113,6 +113,9 @@
  static int     usermount = 0;  /* if 1, non-root can mount fs. */
  SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");

+static int     mdrofs = 0;  /* 1 if md root is read-only (i.e. iso9660) */
+TUNABLE_INT("vfs.mdrofs", &mdrofs);
+
  MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");

  /* List of mounted filesystems. */
@@ -1318,8 +1321,11 @@
         if ((path[0] != 0) && setrootbyname(path))
                 printf("setrootbyname failed\n");

-       /* If the root device is a type "memory disk", mount RW */
-       if (rootdev != NODEV && devsw(rootdev) != NULL) {
+       /*
+        * If the root device is a type "memory disk", mount RW
+        * unless requested otherwise by the loader
+        */
+       if (mdrofs == 0 && rootdev != NODEV && devsw(rootdev) != NULL) {
                 devname = devtoname(rootdev);
                 if (devname[0] == 'm' && devname[1] == 'd')
                         mp->mnt_flag &= ~MNT_RDONLY;






More information about the freebsd-ppc mailing list