Subject: PREP kernel for MCP750/MCPN750
To: NetBSD port-prep <port-prep@NetBSD.org>
From: Michael Stevens <msteven@magma.ca>
List: port-prep
Date: 05/01/2004 18:19:02
--Apple-Mail-9--83955948
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

Hi,

Quite a while back I decided to try and get the NetBSD PREP kernel 
running on some Motorola SBC's that I've got (MCP750 & MCPN750).  What 
I have boots and runs fine so far, but is really just an experimental 
hack.  This is not a real port at this stage and I likely will not get 
back to this for some time, so I figured I should at least make what I 
have available.

Asides from the less than clean changes I've made, there are obvious 
items not covered; e.g. the large bank of FLASH has not been mapped in. 
  Also, as I do not have transition modules for these cPCI boards, I 
have been doing everything over NFS (Boot, root, swap) and serial 
ports.

I'll include my patch file for the 1.6 source tree, but the real 
changes in this "hack" are:

1)  arch/prep/isa/mkclock_isa.c:  Exclude NVRAM size check as the clock 
device is slightly different and causes boot issues ("hack" remember).

2) arch/prep/prep/mainbus.c:  mainbus_attach(),  lengthened the pciio 
extent to 0x00027fff.

3) arch/prep/prep/platform.c: reset_unknown() now calls 
reset_prep_generic().

4) dev/pci/pciconf.c:  setup_iowins()  test pi->address against 
0xffffffff instead of -1 as there is some type issues here (likely a 
real bug, but I don't recall how far I tracked this down).

Other issues:  make sure that the MCP750 is in PREP boot mode (see 
PPCBUG manual).

I'm providing my patch file and the configuration file.  There's extra 
garbage in the patch file, but nothing exciting.  The configuration 
file is just a very pared down version of the GENERIC one.

As I know I will not get back to this for some time, if someone wants 
to start a proper port then I can likely provide an MCP750 cPCI board, 
but no chassis or backplane or transition module.  Also, if there is 
some real interest in this platform, then I could likely be encouraged 
to get back into it.

Cheers,
Michael Stevens



--Apple-Mail-9--83955948
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="PREPmcp750hack.patch"
Content-Disposition: attachment;
	filename=PREPmcp750hack.patch

diff -r /mnt/sys/arch/prep/isa/mkclock_isa.c sys/arch/prep/isa/mkclock_isa.c
117c117
< 
---
> printf("+++ mkclock_isa_match: (1)\n"); /* ++++ PMS, debuggering ++++ */
122a123
> printf("+++ mkclock_isa_match: (2)\n"); /* ++++ PMS, debuggering ++++ */
126a128
> printf("+++ mkclock_isa_match: (3)\n"); /* ++++ PMS, debuggering ++++ */
130a133
> printf("+++ mkclock_isa_match: (4)\n"); /* ++++ PMS, debuggering ++++ */
134a138,140
> printf("+++ mkclock_isa_match: (5) %ld\n",res->VitalProductData.NvramSize
> ); /* ++++ PMS, debuggering ++++ */
> #if 0 /* ++++ PMS ,debuggering ++++ */
137c143,144
< 
---
> #endif
> printf("+++ mkclock_isa_match: (6)\n"); /* ++++ PMS, debuggering ++++ */
143a151
> printf("+++ mkclock_isa_match: (7)\n"); /* ++++ PMS, debuggering ++++ */
194a203
> printf("+++ mkclock_isa_match: (8)\n"); /* ++++ PMS, debuggering ++++ */
diff -r /mnt/sys/arch/prep/prep/mainbus.c sys/arch/prep/prep/mainbus.c
131a132
> #if 0	/* ++++ PMS, debuggering ++++ */
133a135,138
> #else
> 	ioext  = extent_create("pciio",  0x00008000, 0x00027fff, M_DEVBUF,
> 	    NULL, 0, EX_NOWAIT); 
> #endif
diff -r /mnt/sys/arch/prep/prep/platform.c sys/arch/prep/prep/platform.c
126a127,129
>     /* ++++ PMS, debuggering, all code added by moi ++++ */
>     /* asm ("addi 10,0,0x0063; sc");       Dropout to PPCBUG */
>     reset_prep_generic();
diff -r /mnt/sys/dev/pci/pciconf.c sys/dev/pci/pciconf.c
670a671
> #if 0 	/* ++++ PMS, debuggering ++++ */
671a673,675
> #else
> 		if (pi->address == 0xffffffff) {
> #endif

--Apple-Mail-9--83955948
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="prep.pms"
Content-Disposition: attachment;
	filename=prep.pms

# $NetBSD: GENERIC,v 1.51.4.1 2002/08/01 04:30:47 lukem Exp $
#
# GENERIC machine description file
# 
# This machine description file is used to generate the default NetBSD
# kernel.  The generic kernel does not include all options, subsystems
# and device drivers, but should be useful for most applications.
#
# The machine description file can be customised for your specific
# machine to reduce the kernel size and improve its performance.
#
# For further information on compiling NetBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

# copied std options in here, exclude a.out support.
# include 	"arch/prep/conf/std.prep"
machine         prep powerpc
options         EXEC_SCRIPT     # exec #! scripts
options         EXEC_ELF32      # exec ELF binaries
#options         EXEC_AOUT       # exec a.out binaries
options         PPC_MPC6XX
makeoptions     PPCDIR="mpc6xx" # Tell Makefile.powerpc what dir to use

#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary

#ident		"GENERIC-$Revision: 1.51.4.1 $"

maxusers	8

# Platform support
#options 	PLATFORM_IBM_6050		# IBM Personal Power Series 830
#options 	PLATFORM_IBM_7248		# IBM RS/6000 7248-100/120/133
#options 	PLATFORM_MOTOROLA_ULMB60XA	# Motorola ULMB60xA (?)

# Standard system options

options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop

options 	KTRACE		# system call tracing via ktrace(1)

options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
#options 	SEMMNI=10	# number of semaphore identifiers
#options 	SEMMNS=60	# number of semaphores in system
#options 	SEMUME=10	# max number of undo entries per process
#options 	SEMMNU=30	# number of undo structures in system
options 	SYSVSHM		# System V-like memory sharing
#options 	SHMMAXPGS=1024	# 1024 pages is the default

options 	LKM		# loadable kernel modules

#options 	USERCONF	# userconf(4) support
#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)

# Diagnostic/debugging support options
options 	DIAGNOSTIC	# cheap kernel consistency checks
options 	DEBUG		# expensive debugging checks/support
#options 	KMEMSTATS	# kernel memory statistics (vmstat -m)
options 	DDB		# in-kernel debugger
#options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
#makeoptions	DEBUG="-g"

# Compatibility options
#options 	COMPAT_13	# NetBSD 1.3,
#options 	COMPAT_14	# NetBSD 1.4,
#options 	COMPAT_15	# NetBSD 1.5,
#options 	COMPAT_43	# and 4.3BSD
#options 	COMPAT_LINUX	# Linux binary compatibility
#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.

# File systems
#file-system 	FFS		# UFS
#file-system	EXT2FS		# second extended file system (linux)
#file-system	LFS		# log-structured file system
#file-system 	MFS		# memory file system
file-system 	NFS		# Network File System client
#file-system	NTFS		# Windows/NT file system (experimental)
#file-system 	CD9660		# ISO 9660 + Rock Ridge file system
file-system 	MSDOSFS		# MS-DOS file system
#file-system 	FDESC		# /dev/fd
file-system 	KERNFS		# /kern
file-system 	NULLFS		# loopback file system
#file-system	OVERLAY		# overlay file system
#file-system 	PORTAL		# portal filesystem (still experimental)
file-system 	PROCFS		# /proc
#file-system 	UMAPFS		# NULLFS + uid and gid remapping
#file-system 	UNION		# union file system
#file-system	CODA		# Coda File System; also needs vcoda (below)

# File system options
#options 	QUOTA		# UFS quotas
#options 	FFS_EI		# FFS Endian Independant support
#options 	SOFTDEP		# FFS soft updates support.
#options 	NFSSERVER	# Network File System server
#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.

# Networking options
#options 	GATEWAY		# packet forwarding
options 	INET		# IP + ICMP + TCP + UDP
#options 	INET6		# IPv6
#options 	IPSEC		# IP security
#options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
#options 	IPSEC_DEBUG	# debug for IP security
#options 	MROUTING	# IP multicast routing
#options 	NETATALK	# AppleTalk networking protocols
#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
#options 	PPP_DEFLATE	# Deflate compression support for PPP
#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
#options 	PFIL_HOOKS	# pfil(9) packet filter hooks
#options 	IPFILTER_LOG	# ipmon(8) log support
#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG

# These options enable verbose messages for several subsystems.
# Warning, these may compile large string tables into the kernel!
#options 	MIIVERBOSE	# verbose PHY autoconfig messages
options 	PCIVERBOSE	# verbose PCI device autoconfig messages
#options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
#options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
#options 	SCSIVERBOSE	# human readable SCSI error messages
#options 	USBVERBOSE	# verbose USB device autoconfig messages
#options 	RESIDUAL_DATA_DUMP	# verbosely dump residual data

options 	NFS_BOOT_BOOTP
#options 	NFS_BOOT_BOOTPARAM
#options 	NFS_BOOT_DHCP

#
# wscons options
#
# builtin terminal emulations
#options 	WSEMUL_VT100		# VT100 / VT220 emulation
# different kernel output - see dev/wscons/wsdisplayvar.h
#options 	WS_KERNEL_FG=WSCOL_GREEN
#options 	WS_KERNEL_BG=WSCOL_BLACK
# see dev/pckbc/wskbdmap_mfii.c for implemented layouts
#options 	PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
# allocate a number of virtual screens at autoconfiguration time
#options 	WSDISPLAY_DEFAULTSCREENS=4
# use a large software cursor that doesn't blink
#options 	PCDISPLAY_SOFTCURSOR

# Kernel root file system and dump configuration.
#config	netbsd	root on ? type ?
config	netbsd	root on tlp0 type nfs
#config	netbsd	root on le0 type nfs


#
# Device configuration
#

mainbus0 at root
cpu0	at mainbus0


# Basic Bus Support

# PCI bus support
pci0	at mainbus0 bus ?
pci*	at pchb? bus ?
pci*	at ppb? bus ?

options 	PCI_NETBSD_CONFIGURE

# PCI bridges
pchb*	at pci? dev ? function ?	# PCI-Host bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
pcib*	at pci? dev ? function ?	# PCI-ISA bridges

# ISA bus support
isa*	at pcib?			# ISA on PCI-ISA bridge

# PCMCIA bus support
#pcmcia* at pcic? controller ? socket ?

# ISA PCMCIA controllers
#pcic0	at isa? port 0x3e0 iomem 0xd0000 iosiz 0x10000

#options 	PCIC_ISA_INTR_ALLOC_MASK=0x4a00 # free irq 9,11,14
#options 	PCIC_ISA_ALLOC_IOBASE=0x0400
#options 	PCIC_ISA_ALLOC_IOSIZE=0x0100

# ISA Plug-and-Play bus support
#isapnp0	at isa?

# on-board I/O for IBM Personal Power Series 830 IDE controller
#obio0	at mainbus0


# Console Devices

# wscons
#pckbc0		at isa?			# pc keyboard controller
#pckbd*		at pckbc?		# PC keyboard
#pms*		at pckbc?		# PS/2 mouse for wsmouse
#vga*		at pci?
#wsdisplay*	at vga? console ?
#wskbd*		at pckbd? console ?
#wsmouse*	at pms? mux 0

pcppi0	at isa?				# PC prog. periph. interface
#isabeep0 at pcppi?			# "keyboard" beep

#mcclock0 at isa? port 0x70		# mc146818 and compatible
mkclock0 at isa? port 0x74		# mk48t18 and compatible


# Serial Devices

# ISA serial interfaces
com0	at isa? port 0x3f8 irq 4	# standard PC serial ports
com1	at isa? port 0x2f8 irq 3

# PCMCIA serial interfaces
#com*	at pcmcia? function ?		# Modems and serial cards

#pcmcom* at pcmcia? function ?		# PCMCIA multi-port serial cards
#com*	at pcmcom? slave ?		# ...and the slave devices


# Parallel Printer Interfaces

# ISA parallel printer interfaces
#lpt0	at isa? port 0x3bc irq 7	# standard PC parallel ports


# SCSI Controllers and Devices

# PCI SCSI controllers
#adw*	at pci? dev ? function ?	# AdvanSys 9x0UW[D], 3940U[2,3]W SCSI
#ahc*	at pci? dev ? function ?	# Adaptec [23]94x, aic78x0 SCSI
#iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
#pcscp*	at pci? dev ? function ?	# AMD 53c974 PCscsi-PCI SCSI
#siop*	at pci? dev ? function ?	# Symbios 53c8xx SCSI

# PCMCIA SCSI controllers
#aic*	at pcmcia? function ?		# Adaptec APA-1460 SCSI

# SCSI bus support
#scsibus* at adw?
#scsibus* at ahc?
#scsibus* at aic?
#scsibus* at iha?
#scsibus* at pcscp?
#scsibus* at siop?

# SCSI devices
#sd*	at scsibus? target ? lun ?	# SCSI disk drives
#st*	at scsibus? target ? lun ?	# SCSI tape drives
#cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
#ch*	at scsibus? target ? lun ?	# SCSI autochangers
#ss*	at scsibus? target ? lun ?	# SCSI scanners
#uk*	at scsibus? target ? lun ?	# SCSI unknown


# IDE and related devices

# IBM Personal Power Series 830 IDE controller
#wdc0	at obio? port 0x1f0 irq 13
#wdc1	at obio? port 0x170 irq 13

# ISA Plug-and-Play IDE controllers
#wdc*	at isapnp?

# PCMCIA IDE controllers
#wdc*	at pcmcia? function ?

# IDE drives
# Flags are used only with controllers that support DMA operations
# and mode settings (e.g. some pciide controllers)
# The lowest order four bits (rightmost digit) of the flags define the PIO
# mode to use, the next set of four bits the DMA mode and the third set the
# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
# to use, and the last bit must be 1 for this setting to be used.
# For DMA and UDMA, 0xf (1111) means 'disable'.
# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
# (0xc=1100, 0xa=1010, 0xf=1111)
# 0x0000 means "use whatever the drive claims to support".
#wd*	at wdc? channel ? drive ? flags 0x0000

# ATAPI bus support
#atapibus* at wdc? channel ?

# ATAPI devices
# flags have the same meaning as for IDE drives.
#cd*	at atapibus? drive ? flags 0x0000	# ATAPI CD-ROM drives
#sd*	at atapibus? drive ? flags 0x0000	# ATAPI disk drives
#uk*	at atapibus? drive ? flags 0x0000	# ATAPI unknown


# Network Interfaces

# PCI network interfaces
#ep*	at pci? dev ? function ?	# 3Com 3c59x
#ex*	at pci? dev ? function ?	# 3Com 3c90x[BC]
#fxp*	at pci? dev ? function ?	# Intel EtherExpress PRO 10+/100B
#ne*	at pci? dev ? function ?	# NE2000-compatible Ethernet
#pcn*	at pci? dev ? function ?	# AMD PCnet-PCI Ethernet
#rtk*	at pci? dev ? function ?	# Realtek 8129/8139
#sip*	at pci? dev ? function ?	# SiS 900/DP83815 Ethernet
tlp*	at pci? dev ? function ?	# DECchip 21x4x and clones
#vr*	at pci? dev ? function ?	# VIA Rhine Fast Ethernet

# ISA network interfaces
#ep*	at isa? port ? irq ?		# 3Com 3c509 Ethernet
#ne0	at isa? port 0x280 irq 9	# NE2000-compatible Ethernet
#ne1	at isa? port 0x300 irq 10
#we0	at isa? port 0x280 iomem 0xd0000 irq 9	# WD/SMC Ethernet

# ISA Plug-and-Play network intefaces
#ep*	at isapnp?			# 3Com 3c509 Ethernet
#ne*	at isapnp?			# NE2000-compatible Ethernet

# PCMCIA network interfaces
#ep*	at pcmcia? function ?		# 3Com 3c589 and 3c562 Ethernet
#ne*	at pcmcia? function ?		# NE2000-compatible Ethernet

# MII/PHY support
#dmphy*	at mii? phy ?			# Davicom DM9101 PHYs
#exphy*	at mii? phy ?			# 3Com internal PHYs
#icsphy* at mii? phy ?			# Integrated Circuit Systems ICS189x
inphy*	at mii? phy ?			# Intel 82555 PHYs
#iophy*	at mii? phy ?			# Intel 82553 PHYs
#lxtphy* at mii? phy ?			# Level One LXT-970 PHYs
#nsphy*	at mii? phy ?			# NS83840 PHYs
#nsphyter* at mii? phy ?		# NS83843 PHYs
#qsphy*	at mii? phy ?			# Quality Semiconductor QS6612 PHYs
#sqphy*	at mii? phy ?			# Seeq 80220/80221/80223 PHYs
#tlphy*	at mii? phy ?			# ThunderLAN PHYs
#tqphy*	at mii? phy ?			# TDK Semiconductor PHYs
ukphy*	at mii? phy ?			# generic unknown PHYs


# USB Controller and Devices

# PCI USB controllers
#uhci*	at pci? dev ? function ?	# Universal Host Controller (Intel)
#ohci*	at pci? dev ? function ?	# Open Host Controller

# USB bus support
#usb*	at uhci?
#usb*	at ohci?

# USB Hubs
#uhub*	at usb?
#uhub*	at uhub? port ? configuration ? interface ?

# USB HID device
#uhidev*	at uhub? port ? configuration ? interface ?

# USB Mice
#ums*	at uhidev? reportid ?
#wsmouse* at ums? mux 0

# USB Keyboards
#ukbd*	at uhidev? reportid ?
#wskbd*	at ukbd? console ? mux 1

# USB Generic HID devices
#uhid*	at uhidev? reportid ?

# USB Printer
#ulpt*	at uhub? port ? configuration ? interface ?

# USB Modem
#umodem* at uhub? port ? configuration ?
#ucom*	at umodem?

# USB Mass Storage
#umass*	at uhub? port ? configuration ? interface ?
#scsibus* at umass? channel ?
#atapibus* at umass? channel ?

# USB audio
#uaudio* at uhub? port ? configuration ?

# USB Ethernet adapters
#aue*	at uhub? port ?		# ADMtek AN986 Pegasus based adapters
#cue*	at uhub? port ?		# CATC USB-EL1201A based adapters
#kue*	at uhub? port ?		# Kawasaki LSI KL5KUSB101B based adapters

# Prolofic PL2301/PL2302 host-to-host adapter
#upl*	at uhub? port ?

# Serial adapters
# FTDI FT8U100AX serial adapter
#uftdi*	at uhub? port ?
#ucom*	at uftdi? portno ?

# Diamond Multimedia Rio 500
#urio*	at uhub? port ?

# USB Handspring Visor
#uvisor* at uhub? port ?
#ucom*	at uvisor?

# Y@P firmware loader
#uyap* at uhub? port ?

# USB Generic driver
#ugen*	at uhub? port ?

# USB scanners
#uscanner* at uhub? port ?


# Audio device

# ISA Plug-and-Play audio devices
#wss*	at isapnp?			# CS4232

# Audio support
#audio*	at uaudio?
#audio*	at wss?

# MIDI support
#midi*	at pcppi?		# MIDI interface to the PC speaker

# The spkr driver provides a simple tone interface to the built in speaker.
#spkr0	at pcppi?		# PC speaker


# Joysticks

# ISA Plug-and-Play joysticks
#joy*	at isapnp?			# Game ports (usually on audio cards)

# ISA joysticks. Probe is a little strange; add only if you have one.
#joy0	at isa? port 0x201


# Pseudo-Devices

# disk/mass storage pseudo-devices
#pseudo-device	ccd		4	# concatenated/striped disk devices
#pseudo-device	raid		8	# RAIDframe disk driver
#options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
# Options to enable various other RAIDframe RAID types.
# options	RF_INCLUDE_EVENODD=1
# options	RF_INCLUDE_RAID5_RS=1
# options	RF_INCLUDE_PARITYLOGGING=1
# options	RF_INCLUDE_CHAINDECLUSTER=1
# options	RF_INCLUDE_INTERDECLUSTER=1
# options 	RF_INCLUDE_PARITY_DECLUSTERING=1
# options	RF_INCLUDE_PARITY_DECLUSTERING_DS=1
#pseudo-device	md		1	# memory disk device (ramdisk)
#pseudo-device	vnd		4	# disk-like interface to files

# network pseudo-devices
pseudo-device	loop			# network loopback
#pseudo-device	bpfilter	8	# Berkeley packet filter
#pseudo-device	ipfilter		# IP filter (firewall) and NAT
#pseudo-device	ppp		2	# Point-to-Point Protocol
#pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
#pseudo-device	sl		2	# Serial Line IP
#pseudo-device	strip		2	# Starmode Radio IP (Metricom)
#pseudo-device	tun		2	# network tunneling over tty
#pseudo-device	gre		2	# generic L3 over IP tunnel
#pseudo-device	gif		4	# IPv[46] over IPv[46] tunnel (RFC1933)
#pseudo-device	faith		2	# IPv[46] tcp relay translation i/f
#pseudo-device	stf		2	# 6to4 IPv6 over IPv4 encapsulation
#pseudo-device	vlan			# IEEE 802.1q encapsulation
#pseudo-device	bridge			# simple inter-network bridging

# miscellaneous pseudo-devices
pseudo-device	pty			# pseudo-terminals
#pseudo-device	tb		1	# tablet line discipline
#pseudo-device	sequencer	1	# MIDI sequencer
pseudo-device	rnd			# /dev/random and in-kernel generator
#options 	RND_COM			# use "com" randomness as well
#pseudo-device	clockctl		# user control of clock subsystem

# a pseudo device needed for Coda	# also needs CODA (above)
#pseudo-device	vcoda		4	# coda minicache <-> venus comm.

# wscons pseudo-devices
#pseudo-device	wsmux			# mouse & keyboard multiplexor
#pseudo-device	wsfont

--Apple-Mail-9--83955948
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed



--Apple-Mail-9--83955948--