Zbr's days.
May
Sun Mon Tue Wed Thu Fri Sat
   
24
   
2007
Months
May

About TODO Blog RSS Old blog Projects Gallery Notes

Thu, 24 May 2007

A very small progress of SuperH booting today.


I've compiled RedBoot and about to compile SuperH Linux kernel, but since I do not have Compact Flash reader I can not reflash an image, so I've stopped for now.
Tomorrow I will get a flash reader and continue, likely (unfortunately) it will not be that hard to start a linux kernel on that board, since it is well supported.

Update: SuperH kernel for Hitachi SuperH SH7751R CPU can not be compiled with SMP support. This CPU can not be put into SMP system, but it is not a reason to fail building, isn't it? There is a default config for landisk board in Linux kernel, but it is not interesting to use it, so I'm playing with own set of options.
Update2: SuperH really lacks SMP support. Check this atomic increment instruction:

static inline void atomic_add(int i, atomic_t *v)
{
	unsigned long flags;

	local_irq_save(flags);
	*(long *)v += i;
	local_irq_restore(flags);
}
And never ever use read/write locks, on SuperH it ends up with following:
static inline void __raw_read_lock(raw_rwlock_t *rw)
{
	__raw_spin_lock(&rw->lock);
	atomic_inc(&rw->counter);
	__raw_spin_unlock(&rw->lock);
}
But nevertheless I continue to try to build SMP kernel, let's see where this will end up.

Update3: SMP/locks somehow compile, but there is a problem with power management compilation - all modern SuperH CPUs support power management and there are even header files for each CPU family, but power management code uses private constants which are only defined for SuperH-3 family, while 7751 is SH-4 system, so I need to read CPU power management datasheet and probably change some bits to continue... Default config for landisk does not turn power management on.

/devel/sh :: Link / Comments (0)


OpenBSD firmware on landisk SuperH board.


SH IPL+g version 0.9, Copyright (C) 2000 Free Software Foundation, Inc.

This software comes with ABSOLUTELY NO WARRANTY; for details type `w'.
This is free software, and you are welcome to redistribute it under
certain conditions; type `l' for details.

2002/09/09 Making.  2004/09/08 I-O DATA NSU Update.
266:133:33 on base clock 22.22MHz and SDRAM 4 burst. CF boot.

PCIC initialization done.
MASTER:48bit LBA mode non support
Disk drive detected: LEXAR ATA FLASH V1.00 11014102039199095066 
LBA: 001EBF10
DiskSize: 1031675904Byte
PIO MODE1
Set Transfer Mode result: 50 
> b
Set Transfer Mode result: 50 
Initialize Device Parameters result: 50 
IDLE result: 50 

OpenBSD MBR

OpenBSD/landisk Primary Bootstrap
>> OpenBSD/landisk BOOT 0.99
boot> 
booting cf:/bsd: 2690340+264524 [72+128848+115558]=0x30d35c
[ using 244972 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2006 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 4.0-current (GENERIC) #9: Thu Nov  9 14:49:28 MST 2006
    root@landisk.openbsd.org:/sys/arch/landisk/compile/GENERIC
I-O DATA USL-5P
real mem = 67108864 (65536K)
avail mem = 58761216 (57384K)
using 844 buffers containing 3457024 bytes (3376K) of memory
mainbus0 (root)
cpu0 at mainbus0: HITACHI SH4 266.666 MHz PCLOCK 33.333 MHz
cpu0: 8KB/32B direct-mapped Instruction cache.
cpu0: 16KB/32B direct-mapped Data cache.
cpu0: P0, U0, P3 write-through; P1 write-through
cpu0: full-associative 4 ITLB, 64 UTLB entries
cpu0: multiple virtual storage mode, SQ access: kernel, wired 61
shb0 at mainbus0
scif0 at shb0
scif0: console
rsclock0 at shb0: RS5C313 real time clock
shpcic0 at mainbus0: HITACHI SH7751R
pci0 at shpcic0
re0 at pci0 dev 0 function 0 "Realtek 8139" rev 0x20: irq 5, address 00:a0:b0:6c:d0:eb
rlphy0 at re0 phy 0: RTL internal PHY
ohci0 at pci0 dev 2 function 0 "NEC USB" rev 0x43: irq 7, version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: NEC OHCI root hub, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ohci1 at pci0 dev 2 function 1 "NEC USB" rev 0x43: irq 8, version 1.0
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 2 function 2 "NEC USB" rev 0x04: irq 5
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: NEC EHCI root hub, rev 2.00/1.00, addr 1
uhub2: 5 ports with 5 removable, self powered
obio0 at mainbus0
wdc0 at obio0 port 0x14000000-0x1400000f irq 10
wd0 at wdc0 channel 0 drive 0: 
wd0: 16-sector PIO, LBA, 983MB, 2014992 sectors
wd0(wdc0:0:0): using BIOS timings
boot device: 
rootdev=0x1000 rrootdev=0x1000 rawdev=0x1002
WARNING: / was not properly unmounted
Automatic boot in progress: starting file system checks.
/dev/rwd0a: 7631 files, 139253 used, 355342 free (54 frags, 44411 blocks, 0.0% fragmentation)
/dev/rwd0a: MARKING FILE SYSTEM CLEAN
setting tty flags
starting network
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 1
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 1
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 2
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 2
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 2
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 2
DHCPDISCOVER on re0 to 255.255.255.255 port 67 interval 2
DHCPOFFER from 192.168.0.1
DHCPOFFER from 192.168.0.1
DHCPOFFER already seen.
DHCPREQUEST on re0 to 255.255.255.255 port 67
DHCPREQUEST on re0 to 255.255.255.255 port 67
DHCPREQUEST on re0 to 255.255.255.255 port 67
DHCPREQUEST on re0 to 255.255.255.255 port 67
DHCPREQUEST on re0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
duplicate IP address 192.168.0.205 sent from ethernet address 00:11:2f:d3:ed:6a
bound to 192.168.0.205 -- renewal in 3600 seconds.
starting system logger
starting initial daemons: ntpd.
savecore: /bsd: kvm_read: version misread
checking quotas: done.
building ps databases: kvm dev.
clearing /tmp
starting pre-securelevel daemons:.
setting kernel security level: kern.securelevel: 0 -> 1
preserving editor files
/etc/rc[515]: /usr/libexec/vi.recover: No such file or directory
starting network daemons: sendmail inetd sshd.
starting local daemons:.
standard daemons: cron.
Thu May 24 12:00:53 EDT 2007

OpenBSD/landisk (landshark.westerback.to) (console)

login: 
There is only one problem - that is not what I want, so in a couple of moments it will be killed.

Hmm, it looks like it is self hosted on machine landisk.openbsd.org.

Mwa-ha-ha, openbsd.org has banned my IP address after I tried to establish a connection with landisk.openbsd.org machine over 22 port to check is this machine really opened to internet. Is it famous OpenBSD security? Because of that stupid fear of the world I can not read theirs FAQ to determine known bootloader commands and features (mainly is it possible to load other kernel except OpenBSD), so it looks like I need just to erase openbsd and install u-bot bootloader instead.

Or maybe not, I tried from another IP address and failed to connect too.

C2K7 OpenBSD hackathon has started!

/devel/sh :: Link / Comments (0)


My workplace things.


PPC32 and SuperH boards.

PPC32 and SuperH boards

Closer look and my workplace photo with descriptions can be found in album.

Direct link (1 Mb) (preview) to dual-head workplace. Actually I do not see that two monitors help me more than one in development, but I needed to get something from my boss, when we made a bet if it is possible to write a ppc 405 gpr watchdog driver in one day instead of one week with full testing and 'soft' reset configuation. It is possible, task was pretty simple, so now I have two monitors, although only see a gain when watching a movie on one desktop and browse or readmail on another...

Anyway, I always liked to see different dmesgs and workplace photos, so feel free to drop a link.

Update: First time I booted 2.6 kernel on above PPC board almost two years ago.

/devel/other :: Link / Comments (0)