Re: mips "Creator ci20" port

2014-12-25 Thread Michael
Hello,

I made some progress:
U-Boot SPL 2013.10-rc3-g9329ab16a204 (Jun 26 2014 - 09:43:22)
SDRAM H5TQ2G83CFR initialization... done


U-Boot 2013.10-rc3-g9329ab16a204 (Jun 26 2014 - 09:43:22)

Board: ci20 (Ingenic XBurst JZ4780 SoC)
DRAM:  1 GiB
NAND:  8192 MiB
MMC:   jz_mmc msc1: 0
In:eserial3
Out:   eserial3
Err:   eserial3
Net:   dm9000
ci20# dhcp
ERROR: resetting DM9000 -> not responding
dm9000 i/o: 0xb600, id: 0x9a46 
DM9000: running in 8 bit mode
MAC: d0:31:10:ff:7e:89
operating at 100M full duplex mode
BOOTP broadcast 1
DHCP client bound to address 192.168.0.47
*** Warning: no boot file name; using 'C0A8002F.img'
Using dm9000 device
TFTP from server 192.168.0.44; our IP address is 192.168.0.47
Filename 'C0A8002F.img'.
Load address: 0x8800
Loading: #
 #
 316.4 KiB/s
done
Bytes transferred = 1320126 (1424be hex)
ci20# bootm
## Booting kernel from Legacy Image at 8800 ...
   Image Name:   evbmips 7.99.3 (CI20)
   Image Type:   MIPS NetBSD Kernel Image (gzip compressed)
   Data Size:1320062 Bytes = 1.3 MiB
   Load Address: 8002
   Entry Point:  8002
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
subcommand not supported
ci20# g 8002
## Starting applicatipmap_steal_memory: seg 0: 0x36d 0x36d 0x 0x
Loaded initial symtab at 0x802a4b34, strtab at 0x802ca164, # entries 9544
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.

NetBSD 7.99.3 (CI20) #68: Thu Dec 25 12:56:50 EST 2014
ml@blackbush:/home/build/obj_evbmips32/sys/arch/evbmips/compile/CI20
Ingenic XBurst
total memory = 1024 MB
avail memory = 1000 MB
mainbus0 (root)
cpu0 at mainbus0: 1200.00MHz (hz cycles = 12, delay divisor = 12)
cpu0: Ingenic XBurst (0x3ee1024f) Rev. 79 with unknown FPC type (0x33) Rev. 0
cpu0: 32 TLB entries, 16MB max page size
cpu0: 32KB/32B 8-way set-associative L1 instruction cache
cpu0: 32KB/32B 8-way set-associative write-back L1 data cache
com0 at mainbus0: Ingenic UART, working fifo
com0: console

apbus0 at mainbus0
dwctwo0 at apbus0: USB controller
usb0 at dwctwo0: USB revision 2.0
starting timer interrupt...
uhub0 at usb0: vendor  DWC2 root hub, class 9/0, rev 2.00/1.00, addr 1
uhub1 at uhub0 port 1: vendor 1a40 USB 2.0 Hub [MTT], class 9/0, rev 2.00/1.00, 
addr 2
uhub1: multiple transaction translators
umass0 at uhub1 port 1 configuration 1 interface 0
umass0: LaCie P'9220 Mobile Drive, rev 2.10/0.06, addr 3
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0:  disk fixed
sd0: 465 GB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 976773168 sectors
uhub2 at uhub1 port 7: vendor 03eb Standard USB Hub, class 9/0, rev 1.10/3.00, 
addr 4
axe0 at uhub2 port 1
axe0: D-LINK CORPORAION DUB-E100, rev 2.00/10.01, addr 5
axe0: Ethernet address 00:80:c8:37:00:e1
ukphy0 at axe0 phy 3: OUI 0x0009c3, model 0x0005, rev. 4
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
root device: axe0
dump device: 
file system (default generic): 
root on axe0
mountroot: trying nfs...
nfs_boot: trying BOOTP
axe0: link state UP (was UNKNOWN)
nfs_boot: BOOTP next-server: 0.0.0.0
nfs_boot: my_addr=192.168.0.209
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=192.168.0.1


So, things that work now:
- serial console
- time counter, based on on-chip 'Operating System Timer'
- timer interrupt, more or less. After a while the whole thing hangs,
  not sure why yet.
- the OTG port, more or less, without DMA. Not sure why DMA doesn't
  work, or what's the deal with the other USB port.

Should make it to userland relatively soon.

Problems:
- no USB DMA. Might have to restrict DMA maps to the lower 256MB or
  something, we'll see.
- the whole thing hangs at some point, either during USB device
  discovery or shortly after. Might be a problem with the timer
  interrupt, for now it has to be re-scheduled every time, I'll just
  use one of the other timers to fire at 100Hz and see if that helps.

have fun
Michael


Re: mips "Creator ci20" port

2014-12-05 Thread Michael
Hello,

On Fri, 5 Dec 2014 14:05:45 +0100
Martin Husemann  wrote:

> On Fri, Dec 05, 2014 at 08:02:08AM -0500, Michael wrote:
> > Hmm, I'm fairly sure that at least two other netbsd people got free
> > ones, apparently they didn't have time to play with them yet.
> 
> I got one, but was waiting for you to commit support for the interrupt
> controller ;-)

That should happen monday or tuesday. I pretty much figured out how to
deal with it by now, just need to write some more or less trivial code.

> Not that I would have had any time recently anyway, but that will
> change soon...

Good, there's a bunch more drivers to write / adapt ;)

My roadmap looks more or less like this:
* initial CPU and UART support - committed
* timer interrupt - works, but not committed yet
* time counter - works, needs to be finished
* hw interrupts - works more or less, needs to be finished
* apbus at mainbus and dwctwo at apbus - written but not really tested
--- I'm hoping to get here by next wednesday
* framebuffer support - going to look at that when USB works
* i2c and RTC support ( there's an external one that we don't support
  yet as far as I can tell, the on-chip RTC is really just another
  counter )
* SMP support - IPIs work ( from core0 to itself ), needs to actually
  attach and spin up the 2nd core
* deal with command line parameters from u-boot ( already exists
  elsewhere )
* sdhc and ethernet support - hoping someone else will do those
* attach the other UARTs ( at some point, should be more or less trivial
  )

have fun
Michael


Re: mips "Creator ci20" port

2014-12-05 Thread Martin Husemann
On Fri, Dec 05, 2014 at 08:02:08AM -0500, Michael wrote:
> Hmm, I'm fairly sure that at least two other netbsd people got free
> ones, apparently they didn't have time to play with them yet.

I got one, but was waiting for you to commit support for the interrupt
controller ;-)

Not that I would have had any time recently anyway, but that will change
soon...

Martin


Re: mips "Creator ci20" port

2014-12-05 Thread Michael
Hello,

On Fri, 5 Dec 2014 11:23:23 +
Justin Cormack  wrote:

> On Fri, Dec 5, 2014 at 2:30 AM, Michael  wrote:
> > Hello,
> >
> > On Thu, 4 Dec 2014 14:21:55 -0800
> > bch  wrote:
> >
> >> I see that there is mention[1] of a porting effort for NetBSD to this
> >> device -- I quickly trawled the commit msgs in the repo and didn't see
> >> any obvious mention of it. Does anybody know the status of NetBSD on
> >> the ci20, or know where to get the status ?
> >
> > I committed very basic support about two weeks ago.
> > It boots a kernel, sets up one CPU and a serial port, talks to the
> > serial port so you can break into ddb and poke around.
> > I've got a few more things more or less working ( timer, interrupts,
> > bus attachments, dwc2 etc. ) that need to be brushed off and committed
> > but I only have time for this for a day or two per week.
> 
> Thanks! I didnt get a free one but I have ordered one now, but they
> are apparently not shipping until end January.

Hmm, I'm fairly sure that at least two other netbsd people got free
ones, apparently they didn't have time to play with them yet.

> Would be good to have support as it is the new standard mips dev
> platform.

Yeah, this looks promising, especially after the disappointment that
Loongson hardware turned out to be.

have fun
Michael


Re: mips "Creator ci20" port

2014-12-05 Thread Michael
Hello,

On Thu, 4 Dec 2014 18:48:32 -0800
bch  wrote:

> Was it an article (that I can't find now) *you* wrote where working w/
> the serial port, you could pass data "by hand", but not w/ a driver,
> currently ?

Had to be the post on blog.netbsd.org, but that problem had been solved
by then.
Turned out the UARTs on this SoC are /almost/ 16550 compatible - the
difference is a bit in the FIFO control register which powers the UART
down if not set, the com driver of course didn't know about it, so as
soon as it took over the port went dead.

have fun
Michael


Re: mips "Creator ci20" port

2014-12-05 Thread Justin Cormack
On Fri, Dec 5, 2014 at 2:30 AM, Michael  wrote:
> Hello,
>
> On Thu, 4 Dec 2014 14:21:55 -0800
> bch  wrote:
>
>> I see that there is mention[1] of a porting effort for NetBSD to this
>> device -- I quickly trawled the commit msgs in the repo and didn't see
>> any obvious mention of it. Does anybody know the status of NetBSD on
>> the ci20, or know where to get the status ?
>
> I committed very basic support about two weeks ago.
> It boots a kernel, sets up one CPU and a serial port, talks to the
> serial port so you can break into ddb and poke around.
> I've got a few more things more or less working ( timer, interrupts,
> bus attachments, dwc2 etc. ) that need to be brushed off and committed
> but I only have time for this for a day or two per week.

Thanks! I didnt get a free one but I have ordered one now, but they
are apparently not shipping until end January. Would be good to have
support as it is the new standard mips dev platform.

Justin


Re: mips "Creator ci20" port

2014-12-04 Thread bch
Yes -- Jonathan pointed out your commit to me... my grep-fu is apparently bad.

Was it an article (that I can't find now) *you* wrote where working w/
the serial port, you could pass data "by hand", but not w/ a driver,
currently ?

Regardless -- the platform looks exciting. Looking forward to seeing
it come along.

Godspeed with your efforts,

-bch

On 12/4/14, Michael  wrote:
> Hello,
>
> On Thu, 4 Dec 2014 14:21:55 -0800
> bch  wrote:
>
>> I see that there is mention[1] of a porting effort for NetBSD to this
>> device -- I quickly trawled the commit msgs in the repo and didn't see
>> any obvious mention of it. Does anybody know the status of NetBSD on
>> the ci20, or know where to get the status ?
>
> I committed very basic support about two weeks ago.
> It boots a kernel, sets up one CPU and a serial port, talks to the
> serial port so you can break into ddb and poke around.
> I've got a few more things more or less working ( timer, interrupts,
> bus attachments, dwc2 etc. ) that need to be brushed off and committed
> but I only have time for this for a day or two per week.
>
> have fun
> Michael
>


Re: mips "Creator ci20" port

2014-12-04 Thread Michael
Hello,

On Thu, 4 Dec 2014 14:21:55 -0800
bch  wrote:

> I see that there is mention[1] of a porting effort for NetBSD to this
> device -- I quickly trawled the commit msgs in the repo and didn't see
> any obvious mention of it. Does anybody know the status of NetBSD on
> the ci20, or know where to get the status ?

I committed very basic support about two weeks ago.
It boots a kernel, sets up one CPU and a serial port, talks to the
serial port so you can break into ddb and poke around.
I've got a few more things more or less working ( timer, interrupts,
bus attachments, dwc2 etc. ) that need to be brushed off and committed
but I only have time for this for a day or two per week.

have fun
Michael


Re: mips "Creator ci20" port

2014-12-04 Thread Jonathan A. Kollasch
On Thu, Dec 04, 2014 at 02:21:55PM -0800, bch wrote:
> I see that there is mention[1] of a porting effort for NetBSD to this
> device -- I quickly trawled the commit msgs in the repo and didn't see
> any obvious mention of it. Does anybody know the status of NetBSD on
> the ci20, or know where to get the status ?
> 
> -bch
> 
> 
> [1] 
> http://blog.imgtec.com/powervr/mips-creator-ci20-development-board-now-available

See 
https://mail-index.netbsd.org/source-changes/2014/11/22/msg060819.html

Jonathan Kollasch