# 9k risc-v cpu server for beagle v with rv32 e24 core + 2 × rv64 u74 cores
dev +dev
	root
	cons
	arch
	env
	pipe
	proc
	mnt
	srv
	dup
#	rtc
	ssl
	tls
	cap
#	pnp		pci
	kprof
	segment
	ether		netif
	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium
	uart
	bridge		log
	sd
# needed for usb kbd input via scan codes
#	kbin
#	usb

sd +dev
	sdmmc		sddwc
#	sdahci		pci sdscsi
#	sdnvme		pci sdscsi

uart +dev
	uarti8250

ip +dev
	tcp
	udp
	ipifc
	icmp
	icmp6
#	ipmux

link +dev
	ethersyngmac
	ethermedium
	loopbackmedium
	netdevmedium
#	usbehci		usbehcipc

misc +dev
	cache

boot cpu
	tcp

rootdir
	boot$CONF.out		boot
	/riscv64/bin/auth/factotum
	/riscv64/bin/ip/ipconfig

conf
	#include "riscv64.h"

	int cpuserver = 1;
	uvlong cpuhz = 1000*1000*1000;	/* rdtsc tick freq */
	uvlong timebase = 6250*1000; /* clint tick freq; fdt rtcclk=6250000 */
	Membank membanks[] = {		/* (address, size) pairs */
		PHYSMEM, GB,		/* don't move Sys */
		3ULL*GB, 144*MB,
		/* skip devices in 2nd GB */
		4ULL*GB, 6ULL*GB,
		0
	};
	char defnvram[] = "#S/sdM0/nvram";

	uintptr uartregs[] = { PAUart0 };
	int nuart = nelem(uartregs);
	vlong uartfreq = 100000000;	/* from beagle dev tree */
	int prmsdelay = 600;

	/* copied the mac address that u-boot uses */
	uchar ether0mac[] = { 0x2c, 0xf7, 0xf1, 0x1b, 0xe3, 0xcb, };

	/* guesswork, as the available beagle v docs are vague */
	Soc soc = {
		.ether[0]= (char *)0x10020000,
		.l2cache = (char *)0x02010000,
		.plic    = (char *)0x0c000000,	/* common */
		.wdog0   = (char *)0x12480000,	/* watchdog reset */
		.sdmmc   = (char *)0x10000000,	/* two sdio actually */
		.dmaincoherent = 1,		/* jh7100 is broken */
	};
	Ioconf ioconfs[] = {	/* devices whose drivers vmap their regs */
		{ "ether", 64*KB, &soc.ether[0], 6, },
		0
	};
	Ioconf socconf[] = { /* devices without drivers that vmap their regs */
		{ "clint", 64*KB, &soc.clint, },
		{ "l2cache", PGSZ, &soc.l2cache, },
		{ "plic",  64*MB, &soc.plic, },		/* common */
		{ "uart",  PGSZ, &soc.uart, 0x49, },
		{ "wdog",  PGSZ, &soc.wdog0, },
		{ "sdmmc", 64*KB, &soc.sdmmc, 4, 0, },
		// { "sdmmc", 64*KB, &soc.sdmmc, 5, 1, },
		0
	};

riscv64
	start
	low
	mach
	mtrap
	strap
	mch
	main
	allocb
	arch
	archbeagle
	archrv
	color
	csr
	dmamalloc
	fakepci
	fakeptenc
	fp
	fpu
	ioconf
#	kbd
	map
	memory
	mmu
	sane
	sbi
	sbicall
	sbiecall
	plic
	trap
port
	alarm
	awaitbit
	byteserial
	chan
	ctype
	dev
	devtab
	edf
	fault
	image
#	latin1
	logpow
	page
	parse
	pgrp
	portclock
	prf
	print
	proc
	ps
	qio
	qlock
	qmalloc
	random
	rebootcmd
	segment
	sysauth
	syscall
	syscallfmt
	sysfile
	sysproc
	sysseg
	systab
	taslock
	tod
	watermarks

#
# controls which directories to look in for source files; must be relative to ..
#
dir
	ip
	port
	../9/port
