Re: Thecus N1200 fix

2012-03-28 Thread Ivan Solonin

On Wed, 28 Mar 2012 17:07:45 +0600, Tobias Ulmer  wrote:


On Wed, Mar 28, 2012 at 01:58:44PM +0600, Ivan Solonin wrote:

Looks like fdisk can't handle the damaged partition table. Can you try
fdisk -i wd0? Or even dd if=/dev/zero of=/dev/rwd0c bs=1m count=1

For the record my installation of this snapshot went fine. The disk was
zero'ed beforehand though.



Mostly you are right but nevertheless "Illegal instruction (core dumped)"  
bug appears. In my case installation almost finishes on zeroed HDD with  
this error message:


man51.tgz100% |*|  9499 KB00:13
Location of sets? (disk ftp http nfs or 'done') [done]
Time appears wrong.  Set to 'Wed Mar 28 23:37:41 YEKT 2012'? [yes]
Saving configuration files...done.
Generating initial host.random file...done.
Making all device nodes...done.
dd: /dev/wd0i: Device not configured
Failed to install bootblocks.
You will not be able to boot OpenBSD from wd0.

#

This error appears even if I use auto layout of filesystems in disklabel  
where wd0i have mount point /usr/src. If I use my custom layout without  
wd0i error message will be the same.

If installation started on nonzeroed HDD I`ve got:

uid 0 on /: file system full

/: write failed, pid 18705 (sleep): user write of 126976@0xfffe at  
550116 failed: 28

file system is full
Illegal instruction
Illegal instruction (core dumped)
Illegal instruction (core dumped)


Ivan



Re: Thecus N1200 fix

2012-03-28 Thread Tobias Ulmer
On Wed, Mar 28, 2012 at 01:58:44PM +0600, Ivan Solonin wrote:
> Available disks are: wd0.
> Which one is the root disk? (or 'done') [wd0]
> Use DUIDs rather than device names in fstab? [yes] no
> Disk: wd0   geometry: 232581/16/63 [234441648 Sectors]
> Offset: 0   Signature: 0xAA55
> Starting Ending LBA Info:
>  #: id  C   H   S -  C   H   S [   start:size ]
> ---
> *0: A6  0   1   1 -  16643  15  63 [  63:16777089 ] OpenBSD
>  1: A6  16644   0   1 - 232437  15  63 [16777152:   217520352 ] OpenBSD
>  2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
>  3: A6 232438   0   1 - 232580  15  63 [   234297504:  144144 ] OpenBSD
> Use (W)hole disk, use the (O)penBSD area, or (E)dit the MBR?
> [OpenBSD] Illegal instruction (core dumped)
> Illegal instruction (core dumped)

Looks like fdisk can't handle the damaged partition table. Can you try
fdisk -i wd0? Or even dd if=/dev/zero of=/dev/rwd0c bs=1m count=1

For the record my installation of this snapshot went fine. The disk was
zero'ed beforehand though.



Re: Thecus N1200 fix

2012-03-28 Thread Ivan Solonin

Hello!

Thank you for the snapshot I`ve tested this one. This is my report of
installation.
Boot of bsd.bin is successful but further another problems appeared: 
this
is a full console output from power on to power down events without
editing.



U-Boot 1.1.3 (FSL Development) (Feb  6 2007 - 12:26:26) MPC83XX

Clock configuration:
  Coherent System Bus:  266 MHz
  Core: 266 MHz
  Local Bus Controller: 266 MHz
  Local Bus: 33 MHz
  DDR:  266 MHz
  I2C:  266 MHz
  TSEC1:266 MHz
  TSEC2:266 MHz
  USB MPH:   88 MHz
  USB DR:88 MHz
CPU: MPC83xx, Rev: 11 at 266.666 MHz
Board: Thecus N1200
I2C:   ready
DRAM:  SDRAM on Local Bus is NOT available!
   DDR RAM: 128 MB
FLASH:  8 MB
PCI1 32bit on PMC1 & PMC2 & PMC3
In:serial
Out:   serial
Err:   serial
Net:   Freescale TSEC0: PHY is Realtek RTL8211B (1cc912)
Freescale TSEC1: PHY id 1410c87 is not supported!
Freescale TSEC1: No PHY found
Freescale TSEC0, Freescale TSEC1
Thecus Version: 4, PIC version: 4
Hit any key to stop autoboot:  0
=> setenv ipaddr 192.168.252.61
=> setenv serverip 192.168.252.62
=> setenv gatewayip 192.168.252.62
=> tftpboot 20 bsd.bin
Speed: 100, full duplex
Using Freescale TSEC0 device
TFTP from server 192.168.252.62; our IP address is 192.168.252.61
Filename 'bsd.bin'.
Load address: 0x20
Loading: #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
done
Bytes transferred = 6240540 (5f391c hex)
=> go 20
## Starting application at 0x0020 ...
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2012 OpenBSD. All rights reserved.
http://www.OpenBSD.org

uvm_km_kmem_grow: grown to 0xe800
OpenBSD 5.1-current (RAMDISK) #70: Sun Mar 25 06:14:05 MDT 2012
dera...@socppc.openbsd.org:/usr/src/sys/arch/socppc/compile/RAMDISK
real mem = 134217728 (128MB)
avail mem = 121892864 (116MB)
mainbus0 at root
cpu0 at mainbus0: 8347
obio0 at mainbus0
"wdt" at obio0 offset 0x00200 not configured
sociic0 at obio0 offset 0x03000 ivec 14
iic0 at sociic0
ricohrtc0 at iic0 addr 0x32: RICOH RS5C372[AB] Real-time Clock
fintek0 at iic0 addr 0x2e: F75375 rev 1.5
sociic1 at obio0 offset 0x03100 ivec 15
iic1 at sociic1
ehci0 at obio0 offset 0x22000 ivec 39
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Freescale EHCI root hub" rev 2.00/1.00 addr 1
tsec0 at obio0 offset 0x24000 ivec 32: address 00:14:fd:10:b9:c8
rgephy0 at tsec0 phy 17: RTL8169S/8110S PHY, rev. 2
tsec1 at obio0 offset 0x25000 ivec 35: address 00:14:fd:10:b9:c9
ukphy0 at tsec1 phy 5: Generic IEEE 802.3u media interface, rev. 0: OUI
0x001400, model 0x0005
ifmedia_set: no match for 0x20/0x
com0 at obio0 offset 0x04500 ivec 9: st16650, no working fifo
com0: console
ipic0 at obio0 offset 0x00700
socpcic0 at mainbus0
pci0 at socpcic0 bus 0
"Freescale MPC8347 PBGA" rev 0x11 at pci0 dev 0 function 0 not configured
pciide0 at pci0 dev 16 function 0 "CMD Technology SiI3512 SATA" rev 0x01:
DMA
pciide0: using ivec 20 for native-PCI interrupt
pciide0: port 0: device present, speed: 1.5Gb/s
wd0 at pciide0 channel 0 drive 0: 
wd0: 16-sector PIO, LBA48, 114473MB, 234441648 sectors
wd0(pciide0:0:0): using BIOS timings, Ultra-DMA mode 5
root on rd0a swap on rd0b dump on rd0b
WARNING: clock lost 7356 days, using FS time -- CHECK AND RESET THE DATE!
%P+,T-B&V 7B&b",B&5B&P9Q+P4=F!L3>kP
Welcome to the OpenBSD/socppc 5.1 installation program.
(I)nstall, (U)pgrade or (S)hell? i
At any prompt except password prompts you can escape to a shell by
typing '!'. Default

Re: Thecus N1200 fix

2012-03-15 Thread iss...@gmail.com IMAP

On Sun, 11 Mar 2012 03:59:24 +0600, Tobias Ulmer  wrote:


(Ivan: would be nice if you could test it and tell us about any
success/failure)

socppc saves registers r3 (fwfdtsave) and r29 (fwargsave) in locore.S.
initppc() checks for the absence of a flat device tree structure, in  
which

case it uses the older bd_t aka bootinfo.

It then checks whether the FDT checksum is valid and eventually uses  
that.


If fwfdtsave (r3) contains rubbish and u-boot does not supply a valid
FDT, it will go into neither branch, doesn't set the amount of memory
and silently panics in pmap.c.

This diff changes the logic to first try the FDT and
unconditionally fall back to bootinfo. If that doesn't work, we're toast
anyway.

I suspect r3 was zero by pure chance and the code works on a different
model. The one I have here has a 8 pin serial connector, unlike what's
described in the install document.

U-boot's README.standalone only mentions r29 being set and I can't find
any reference where it sets r3 in do_go().

Can a kind soul please tell me how to cross-compile a RAMDISK kernel? I
keep running into errors no matter which way I try. It would be nice to
install it, now that it boots :-)

Index: socppc/machdep.c
===
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/socppc/socppc/machdep.c,v
retrieving revision 1.33
diff -u -p -r1.33 machdep.c
--- socppc/machdep.c29 Aug 2011 20:21:44 -  1.33
+++ socppc/machdep.c10 Mar 2012 20:52:06 -
@@ -177,21 +177,6 @@ initppc(u_int startkernel, u_int endkern
/* Make a copy of the args! */
strlcpy(bootpathbuf, args ? args : "wd0a", sizeof bootpathbuf);
-   if (fwfdtsave == NULL) {
-   /*
-* We were loaded by an old U-Boot that didn't provide
-* a flattened device tree.  It should have provided a
-* valid bootinfo structure which we'll use to build
-* such a device tree ourselves.
-*
-* XXX We don't build a flattened device tree yet.
-*/
-   memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
-
-   extern uint8_t dt_blob_start[];
-   fdt_init(&dt_blob_start);
-   }
-
if (fwfdtsave && fwfdtsave->fh_magic == FDT_MAGIC) {
/*
 * Save the FDT firmware blob passed by the bootloader
@@ -231,6 +216,19 @@ initppc(u_int startkernel, u_int endkern
if (fdt_node_property(node, "mac-address", &addr))
memcpy(bootinfo.bi_enetaddr, addr, 6);
}
+   } else {
+   /*
+* We were loaded by an old U-Boot that didn't provide
+* a flattened device tree.  It should have provided a
+* valid bootinfo structure which we'll use to build
+* such a device tree ourselves.
+*
+* XXX We don't build a flattened device tree yet.
+*/
+   memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
+
+   extern uint8_t dt_blob_start[];
+   fdt_init(&dt_blob_start);
}
proc0.p_cpu = &cpu_info[0];





U-Boot 1.1.3 (FSL Development) (Feb  6 2007 - 12:26:26) MPC83XX

Clock configuration:
  Coherent System Bus:  266 MHz
  Core: 266 MHz
  Local Bus Controller: 266 MHz
  Local Bus: 33 MHz
  DDR:  266 MHz
  I2C:  266 MHz
  TSEC1:266 MHz
  TSEC2:266 MHz
  USB MPH:   88 MHz
  USB DR:88 MHz
CPU: MPC83xx, Rev: 11 at 266.666 MHz
Board: Thecus N1200
I2C:   ready
DRAM:  SDRAM on Local Bus is NOT available!
   DDR RAM: 128 MB
FLASH:  8 MB
PCI1 32bit on PMC1 & PMC2 & PMC3
In:serial
Out:   serial
Err:   serial
Net:   Freescale TSEC0: PHY is Realtek RTL8211B (1cc912)
Freescale TSEC1: PHY id 1410c87 is not supported!
Freescale TSEC1: No PHY found
Freescale TSEC0, Freescale TSEC1
Thecus Version: 4, PIC version: 4
Hit any key to stop autoboot:  0
=> boot
Speed: 100, full duplex
Using Freescale TSEC0 device
TFTP from server 10.0.0.10; our IP address is 10.0.0.129
Filename 'bsd.bin.socppc'.
Load address: 0x20
Loading:  
#

 #
 #
 #
 #
 #
 #
 #
 #
 ##

Re: Thecus N1200 fix

2012-03-14 Thread Mark Kettenis
> Date: Sat, 10 Mar 2012 22:59:24 +0100
> From: Tobias Ulmer 
> 
> (Ivan: would be nice if you could test it and tell us about any
> success/failure)
> 
> socppc saves registers r3 (fwfdtsave) and r29 (fwargsave) in locore.S.
> initppc() checks for the absence of a flat device tree structure, in which
> case it uses the older bd_t aka bootinfo.
> 
> It then checks whether the FDT checksum is valid and eventually uses that.
> 
> If fwfdtsave (r3) contains rubbish and u-boot does not supply a valid
> FDT, it will go into neither branch, doesn't set the amount of memory
> and silently panics in pmap.c.
> 
> This diff changes the logic to first try the FDT and
> unconditionally fall back to bootinfo. If that doesn't work, we're toast
> anyway.
> 
> I suspect r3 was zero by pure chance and the code works on a different
> model. The one I have here has a 8 pin serial connector, unlike what's
> described in the install document.
> 
> U-boot's README.standalone only mentions r29 being set and I can't find
> any reference where it sets r3 in do_go().
> 
> Can a kind soul please tell me how to cross-compile a RAMDISK kernel? I
> keep running into errors no matter which way I try. It would be nice to
> install it, now that it boots :-)
> 
> Index: socppc/machdep.c
> ===
> RCS file: /home/vcs/cvs/openbsd/src/sys/arch/socppc/socppc/machdep.c,v
> retrieving revision 1.33
> diff -u -p -r1.33 machdep.c
> --- socppc/machdep.c  29 Aug 2011 20:21:44 -  1.33
> +++ socppc/machdep.c  10 Mar 2012 20:52:06 -
> @@ -177,21 +177,6 @@ initppc(u_int startkernel, u_int endkern
>   /* Make a copy of the args! */
>   strlcpy(bootpathbuf, args ? args : "wd0a", sizeof bootpathbuf);
>  
> - if (fwfdtsave == NULL) {
> - /*
> -  * We were loaded by an old U-Boot that didn't provide
> -  * a flattened device tree.  It should have provided a
> -  * valid bootinfo structure which we'll use to build
> -  * such a device tree ourselves.
> -  *
> -  * XXX We don't build a flattened device tree yet.
> -  */
> - memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
> -
> - extern uint8_t dt_blob_start[];
> - fdt_init(&dt_blob_start);
> - }
> -
>   if (fwfdtsave && fwfdtsave->fh_magic == FDT_MAGIC) {
>   /* 
>* Save the FDT firmware blob passed by the bootloader
> @@ -231,6 +216,19 @@ initppc(u_int startkernel, u_int endkern
>   if (fdt_node_property(node, "mac-address", &addr))
>   memcpy(bootinfo.bi_enetaddr, addr, 6);
>   }
> + } else {
> + /*
> +  * We were loaded by an old U-Boot that didn't provide
> +  * a flattened device tree.  It should have provided a
> +  * valid bootinfo structure which we'll use to build
> +  * such a device tree ourselves.
> +  *
> +  * XXX We don't build a flattened device tree yet.
> +  */
> + memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
> +
> + extern uint8_t dt_blob_start[];
> + fdt_init(&dt_blob_start);
>   }
>  
>   proc0.p_cpu = &cpu_info[0];

Thanks.  Verified that this doesn't break the rb600.  Dereferencing a
garbage pointer is still a bit risky I suppose, but this is better
than what's currently in the tree.  So I have committed this.

New snapshots should start appearing soon.  Not sure if the first one
will have this diff, but the one after that surely will.

Cheers,

Mark



Thecus N1200 fix

2012-03-10 Thread Tobias Ulmer
(Ivan: would be nice if you could test it and tell us about any
success/failure)

socppc saves registers r3 (fwfdtsave) and r29 (fwargsave) in locore.S.
initppc() checks for the absence of a flat device tree structure, in which
case it uses the older bd_t aka bootinfo.

It then checks whether the FDT checksum is valid and eventually uses that.

If fwfdtsave (r3) contains rubbish and u-boot does not supply a valid
FDT, it will go into neither branch, doesn't set the amount of memory
and silently panics in pmap.c.

This diff changes the logic to first try the FDT and
unconditionally fall back to bootinfo. If that doesn't work, we're toast
anyway.

I suspect r3 was zero by pure chance and the code works on a different
model. The one I have here has a 8 pin serial connector, unlike what's
described in the install document.

U-boot's README.standalone only mentions r29 being set and I can't find
any reference where it sets r3 in do_go().

Can a kind soul please tell me how to cross-compile a RAMDISK kernel? I
keep running into errors no matter which way I try. It would be nice to
install it, now that it boots :-)

Index: socppc/machdep.c
===
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/socppc/socppc/machdep.c,v
retrieving revision 1.33
diff -u -p -r1.33 machdep.c
--- socppc/machdep.c29 Aug 2011 20:21:44 -  1.33
+++ socppc/machdep.c10 Mar 2012 20:52:06 -
@@ -177,21 +177,6 @@ initppc(u_int startkernel, u_int endkern
/* Make a copy of the args! */
strlcpy(bootpathbuf, args ? args : "wd0a", sizeof bootpathbuf);
 
-   if (fwfdtsave == NULL) {
-   /*
-* We were loaded by an old U-Boot that didn't provide
-* a flattened device tree.  It should have provided a
-* valid bootinfo structure which we'll use to build
-* such a device tree ourselves.
-*
-* XXX We don't build a flattened device tree yet.
-*/
-   memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
-
-   extern uint8_t dt_blob_start[];
-   fdt_init(&dt_blob_start);
-   }
-
if (fwfdtsave && fwfdtsave->fh_magic == FDT_MAGIC) {
/* 
 * Save the FDT firmware blob passed by the bootloader
@@ -231,6 +216,19 @@ initppc(u_int startkernel, u_int endkern
if (fdt_node_property(node, "mac-address", &addr))
memcpy(bootinfo.bi_enetaddr, addr, 6);
}
+   } else {
+   /*
+* We were loaded by an old U-Boot that didn't provide
+* a flattened device tree.  It should have provided a
+* valid bootinfo structure which we'll use to build
+* such a device tree ourselves.
+*
+* XXX We don't build a flattened device tree yet.
+*/
+   memcpy(&bootinfo, *fwargsave, sizeof bootinfo);
+
+   extern uint8_t dt_blob_start[];
+   fdt_init(&dt_blob_start);
}
 
proc0.p_cpu = &cpu_info[0];





U-Boot 1.1.3 (FSL Development) (Feb  6 2007 - 12:26:26) MPC83XX

Clock configuration:
  Coherent System Bus:  266 MHz
  Core: 266 MHz
  Local Bus Controller: 266 MHz
  Local Bus: 33 MHz
  DDR:  266 MHz
  I2C:  266 MHz
  TSEC1:266 MHz
  TSEC2:266 MHz
  USB MPH:   88 MHz
  USB DR:88 MHz
CPU: MPC83xx, Rev: 11 at 266.666 MHz
Board: Thecus N1200
I2C:   ready
DRAM:  SDRAM on Local Bus is NOT available!
   DDR RAM: 128 MB
FLASH:  8 MB
PCI1 32bit on PMC1 & PMC2 & PMC3
In:serial
Out:   serial
Err:   serial
Net:   Freescale TSEC0: PHY is Realtek RTL8211B (1cc912)
Freescale TSEC1: PHY id 1410c87 is not supported!
Freescale TSEC1: No PHY found
Freescale TSEC0, Freescale TSEC1
Thecus Version: 4, PIC version: 4
Hit any key to stop autoboot:  0
=> boot
Speed: 100, full duplex
Using Freescale TSEC0 device
TFTP from server 10.0.0.10; our IP address is 10.0.0.129
Filename 'bsd.bin.socppc'.
Load address: 0x20
Loading: #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 ###