Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: status for Marvell Orion support



> You don't actually need to put the NetBSD kernel in flash, though that 
> is certainly one option (and one that I would like to explore further).  
> Another way is:
> 1. Create an ext2 slice (for Linux or just for booting) that U-boot can 
> read and a NetBSD slice that you use to install the world on.

Which partitioning method is needed?  A good old MS-DOS-stype
partition table, perhaps?  If so, there's no "fdisk" in the
install image.  That's easily fixable, though.

NetBSD also nowadays has a both newfs_ext2fs and the associated
mount_ex2fs program, so there should be no need to involve Linux
to make it go.  I'm going to try to modify the install ramdisk
list, like this, and see whether that gets us further:

Index: list
===================================================================
RCS file: /cvsroot/src/distrib/evbarm/instkernel/ramdisk/list,v
retrieving revision 1.7
diff -u -p -r1.7 list
--- list        21 May 2008 18:05:29 -0000      1.7
+++ list        14 Mar 2009 20:15:03 -0000
@@ -22,6 +22,7 @@ PROG  bin/sync
 
 PROG   sbin/dhclient
 PROG   sbin/disklabel
+PROG   sbin/fdisk
 PROG   sbin/fsck
 PROG   sbin/fsck_ffs
 PROG   sbin/ifconfig
@@ -29,11 +30,13 @@ PROG        sbin/init
 PROG   sbin/mknod
 PROG   sbin/mount
 PROG   sbin/mount_cd9660
+PROG   sbin/mount_ext2fs
 PROG   sbin/mount_ffs
 PROG   sbin/mount_kernfs
 PROG   sbin/mount_msdos
 PROG   sbin/mount_nfs
 PROG   sbin/newfs      sbin/mount_mfs
+PROG   sbin/newfs_ext2fs
 PROG   sbin/ping
 PROG   sbin/reboot     sbin/halt
 PROG   sbin/restore    sbin/rrestore

The ORION_NAS kernel config already has file-system EXT2FS, so
that should be OK.

...

OK, that got me further:

After running "fdisk -u -0" and "fdisk -u -1", and setting aside
a 31MB-sized area for the ext2fs file system, I ended up with
this MBR partition table:

# fdisk wd0
Disk: /dev/rwd0c
NetBSD disklabel disk geometry:
cylinders: 620181, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 625142448

BIOS disk geometry:
cylinders: 1024, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 625142448

Partition table:
0: Linux native (sysid 131)
    start 63, size 64197 (31 MB, Cyls 0-3)
        PBR is not bootable: All bytes are identical (0x00)
1: NetBSD (sysid 169)
    start 64260, size 625078188 (305214 MB, Cyls 4-38913/80/63)
        PBR is not bootable: All bytes are identical (0x00)
2: <UNUSED>
3: <UNUSED>
No active partition.
# 

This gets reflected in the default disklabel:

8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 c: 625142448         0     unused      0     0        # (Cyl.      0 - 620180)
 e:     64197        63 Linux Ext2      0     0        # (Cyl.      0*-     63*)
 f: 625078188     64260     unused      0     0        # (Cyl.     63*- 620180)

but in the end I didn't end using this particular partition
letter, I just used this output as a reference during
installation, since sysinst has it's own idea about the layout of
the disklabel.


However, when starting sysinst, it's evident it's not been
upgraded for the KUROBOX_PRO, the menu doesn't mention it's
kernel set (yes, I know I still need to copy the .bin kernel to
where U-Boot can get at it).  So, that should be fixable (diff
attached).

BTW, I notice something annoying: it appears that it's not
possible to reboot without power-cycling the box.  This is what I
get when I do "halt" from the install image:

# halt
halted by root
syncing disks... done
unmounting file systems...
unmounting /kern (kernfs)...
unmounting / (/dev/md0a)... done
The operating system has halted.
Please press any key to reboot.
rebooting...
Orion1   CPU =  Low _

I pressed a key at the "Please press any key..." message, but
then it just sits there with the cursor sitting at the location
given by the underscore above.  This is similar to the first line
printed after power-on, but in that case it continues on:

Orion1   CPU =  Low 

=== KURO U-Boot. ===
 ** LOADER **
 ** KUROBOX BOARD: KURO_BOX  LE (CFG_ENV_ADDR=fffff000)

etc.

Anyone know what the problem is with that?


Another nit, is that U-Boot on my box says

Soc: 88F5182 A2
CPU: ARM926 (Rev 0) running @ 500Mhz 
Orion 1 streaming disabled 
SysClock = 250Mhz , TClock = 166Mhz 

during startup of the firmware, but NetBSD prints:

orion0 at mainbus0: Marvell MV88F5182 SoC Rev. A0 Orion1
orion0: CPU Clock 400.000 MHz  SysClock 200.000 MHz  TClock 166.664 MHz

during autoconf.  So who's right?  Or is NetBSD setting the
frequence in some way?


> 2. Install  NetBSD to the disk.
> 3. Put the kernel on the ext2 slice and change the U-boot boot string 
> (bootcmd) to point to the NetBSD kernel instead of the Linux kernel 
> (something like:
> bootcmd=ide reset; ext2load ide 0:1 0x8000 /netbsd.bin-KUROBOX_PRO; g 0x8000
>  - but I'm doing that from memory).  If you can't figure out how/where, 
> I'll have to look back through my notes.

OK, I followed this path, and since sysinst has it's own idea
about the label (or because I didn't pick "use existing"), I
ended up with a label like this (had to manually fiddle the root
file system to push it's start out of the way of the ext2fs
partition):

8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   1370123     64261     4.2BSD   1024  8192     0  # (Cyl.     63*-   1422)
 b:   1049328   1434384       swap                     # (Cyl.   1423 -   2463)
 c: 625142448         0     unused      0     0        # (Cyl.      0 - 620180)
 d: 613851840   2483712     4.2BSD   2048 16384     0  # (Cyl.   2464 - 611443)
 e:   8806896 616335552     4.2BSD   2048 16384     0  # (Cyl. 611444 - 620180)
 f:     64197        63 Linux Ext2      0     0        # (Cyl.      0*-     63*)

I newfs'ed the ext2 fs once more after sysinst completed (I did
that newfs earlier, but I had a false start with sysinst where
the new root partition overlapped the ext2fs slice), and prepared
it for use:

newfs_ext2fs /dev/rwd0f
mount -t ext2fs /dev/wd0f /mnt
cd /mnt
ftp <distribution-server>
get ..../evbarm/binary/kernel/netbsd.bin-KUROBOX_PRO.gz
quit
gunzip netbsd.bin-KUROBOX_PRO.gz
cd /
umount /mnt

With that in place, and a power cycle (see above), I could

Marvell>> ide reset

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
  Device 0: OK
Model: WDC WD3200YS-01PGB0                      Firm: 21.00M21 Ser#:      WD-WCA
PD3890579
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)

Marvell>> ext2ls ide 0
Using device ide 0:1, directory: /
<DIR>       1024 .
<DIR>       1024 ..
<DIR>      12288 lost+found
         5061372 netbsd.bin-KUROBOX_PRO
Marvell>> ext2load ide 0:1 0x8000 /netbsd.bin-KUROBOX_PRO
Using device ide0, partition 1

Loading from block device ide device 0, partition 1: Name: hda1
  Type: U-Boot  File:/netbsd.bin-KUROBOX_PRO

5061372 bytes read
Marvell>> go 0x8000

and off it went.  ("help ext2ls" and "help ext2load" were useful
to see the complete syntax, their output is not shown here.)


One remaining problem at that point is that the kernel could not
detect it's root file system, so I had to reply to a few
questions on the console:

boot device: <unknown>
root device: wd0a
dump device (default wd0b): 
file system (default generic): 
root on wd0a dumps on wd0b
mountroot: trying lfs...
mountroot: trying ffs...
root file system type: ffs
init path (default /sbin/init): 

This can be fixed by adding this line to the KURBOX_PRO
kernel configuration file:

config          netbsd-wd0          root on wd0 type ffs

With that in place, a netbsd-wd0.bin-KUROBOX_PRO.gz file ended up
in $RELEASEDIR/binary/kernel, and with it vanished the prompt for
the root file system and init's path.


> Mine is set right now to boot using tftp using the boot string:
>
> bootcmd=tftp 0x8000 netbsd.bin-KUROBOX_PRO; g 0x8000
>
> This is all still not perfect, since I think you need to use Linux to 
> create the ext2 slice, but closer.

Ref. above and below, no need to run Linux to get this one to go :)

However, what's the exact syntax to set bootcmd?  I made a couple
of attempts of

setenv bootcmd "ide reset; ext2load ide 0:0 0x8000 /netbsd-wd0.bin-KUROBOX_PRO; 
g 0x8000"

but my box reset each time (it's always the small hurdles...)


Oh, yes, a few notes at the end:

My Kurobox_PRO insisted on sounding an annoying alarm whenever I
interrupted the automatic boot sequence on the console.  A second
press on the power button made the alarm turn off.  The red alarm
light is still on, though, even though I'm up and running
multi-user (I've not managed to set the bootcmd variable yet).

...and... I sometimes get this sort of messages on the console:

WARNING: negative runtime; monotonic clock has gone backwards

I'm guessing that's not so good, though probably nonfatal.


Regards,

- Håvard
Index: md.h
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/md.h,v
retrieving revision 1.16
diff -u -p -r1.16 md.h
--- md.h        12 Nov 2007 15:07:35 -0000      1.16
+++ md.h        14 Mar 2009 21:03:13 -0000
@@ -55,6 +55,7 @@
 #define SET_KERNEL_4_NAME      "kern-IQ80321"
 #define SET_KERNEL_5_NAME      "kern-TEAMASA_NPWR"
 #define SET_KERNEL_6_NAME      "kern-TS7200"
+#define SET_KERNEL_7_NAME      "kern-KUROBOX_PRO"
 
 #define MD_SETS_SELECTED SET_SYSTEM
 
Index: msg.md.de
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/msg.md.de,v
retrieving revision 1.6
diff -u -p -r1.6 msg.md.de
--- msg.md.de   2 Feb 2008 05:33:57 -0000       1.6
+++ msg.md.de   14 Mar 2009 21:03:13 -0000
@@ -84,3 +84,5 @@ message set_kernel_5
 {Kernel (TEAMASA_NPWR)}
 message set_kernel_6
 {Kernel (TS7200)}
+message set_kernel_7
+{Kernel (KUROBOX_PRO)}
Index: msg.md.en
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/msg.md.en,v
retrieving revision 1.8
diff -u -p -r1.8 msg.md.en
--- msg.md.en   2 Feb 2008 05:33:57 -0000       1.8
+++ msg.md.en   14 Mar 2009 21:03:13 -0000
@@ -81,3 +81,5 @@ message set_kernel_5
 {Kernel (TEAMASA_NPWR)}
 message set_kernel_6
 {Kernel (TS7200)}
+message set_kernel_7
+{Kernel (KUROBOX_PRO)}
Index: msg.md.es
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/msg.md.es,v
retrieving revision 1.5
diff -u -p -r1.5 msg.md.es
--- msg.md.es   2 Feb 2008 05:33:57 -0000       1.5
+++ msg.md.es   14 Mar 2009 21:03:13 -0000
@@ -84,3 +84,5 @@ message set_kernel_5
 {Núcleo (TEAMASA_NPWR)}
 message set_kernel_6
 {Núcleo (TS7200)}
+message set_kernel_7
+{Núcleo (KUROBOX_PRO)}
Index: msg.md.fr
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/msg.md.fr,v
retrieving revision 1.8
diff -u -p -r1.8 msg.md.fr
--- msg.md.fr   2 Feb 2008 05:33:57 -0000       1.8
+++ msg.md.fr   14 Mar 2009 21:03:13 -0000
@@ -84,3 +84,5 @@ message set_kernel_5
 {Kernel (TEAMASA_NPWR)}
 message set_kernel_6
 {Kernel (TS7200)}
+message set_kernel_7
+{Kernel (KUROBOX_PRO)}
Index: msg.md.pl
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/evbarm/msg.md.pl,v
retrieving revision 1.7
diff -u -p -r1.7 msg.md.pl
--- msg.md.pl   2 Feb 2008 05:33:57 -0000       1.7
+++ msg.md.pl   14 Mar 2009 21:03:13 -0000
@@ -83,3 +83,5 @@ message set_kernel_5
 {Kernel (TEAMASA_NPWR)}
 message set_kernel_6
 {Kernel (TS7200)}
+message set_kernel_7
+{Kernel (KUROBOX_PRO)}


Home | Main Index | Thread Index | Old Index