/*
 * u_int initarm(...)
 *
 * Initial entry point on startup. This gets called before main() is
 * entered.
 * It should be responsible for setting up everything that must be
 * in place when main is called.
 * This includes
 *   Taking a copy of the boot configuration structure.
 *   Initialising the physical console so characters can be printed.
 *   Setting up page tables for the kernel
 *   Relocating the kernel to the bottom of physical memory
 */
u_int
initarm(void *arg)
{
	/*
	 * Heads up ... Setup the CPU / MMU / TLB functions
	 */
	if (set_cpufuncs())
		panic("cpu not recognized!");

	/* map some peripheral registers */
	pmap_devmap_bootstrap((vaddr_t)armreg_ttbr_read() & -L1_TABLE_SIZE,
	    netwalker_devmap);

	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);

	/* Register devmap for devices we mapped in start */
	pmap_devmap_register(netwalker_devmap);
	setup_ioports();

	consinit();

#ifdef	NO_POWERSAVE
	cpu_do_powersave=0;
#endif

	init_clocks();

#ifdef KGDB
	kgdb_port_init();
#endif

	/* Talk to the user */
	printf("\nNetBSD/evbarm (" ___STRING(EVBARM_BOARDTYPE) ") booting ...\n");

#ifdef BOOT_ARGS
	char mi_bootargs[] = BOOT_ARGS;
	parse_mi_bootargs(mi_bootargs);
#endif
	bootargs[0] = '\0';

#if defined(VERBOSE_INIT_ARM) || 1
	printf("initarm: Configuring system");
	printf(", CLIDR=%010o CTR=%#x",
	    armreg_clidr_read(), armreg_ctr_read());
	printf("\n");
#endif
	/*
	 * Ok we have the following memory map
	 *
	 * Physical Address Range     Description
	 * -----------------------    ----------------------------------
	 *
	 * 0x90000000 - 0xAFFFFFFF    DDR SDRAM (512MByte)
	 *
	 * The initarm() has the responsibility for creating the kernel
	 * page tables.
	 * It must also set up various memory pointers that are used
	 * by pmap etc.
	 */

#ifdef VERBOSE_INIT_ARM
	printf("initarm: Configuring system ...\n");
#endif
	/* Fake bootconfig structure for the benefit of pmap.c */
	/* XXX must make the memory description h/w independent */
	bootconfig.dramblocks = 1;
	bootconfig.dram[0].address = MEMSTART;
	bootconfig.dram[0].pages = (MEMSIZE * 1024 * 1024) / PAGE_SIZE;

	psize_t ram_size = bootconfig.dram[0].pages * PAGE_SIZE;

#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
	if (ram_size > KERNEL_VM_BASE - KERNEL_BASE) {
		printf("%s: dropping RAM size from %luMB to %uMB\n",
		    __func__, (unsigned long) (ram_size >> 20),
		    (KERNEL_VM_BASE - KERNEL_BASE) >> 20);
		ram_size = KERNEL_VM_BASE - KERNEL_BASE;
	}
Example #2
0
ATF_TC_HEAD(wait4, tc)
{
	atf_tc_set_md_var(tc, "descr",
	    "Test that wait4(2) returns ECHILD for WAIT_ANY and option %s",
	    ___STRING(TWAIT_OPTION));
}
Example #3
0
	{ DDB_ADD_CMD("watch",	db_watchpoint_cmd,	CS_MORE,
	    "Set a watchpoint for a region. ","address[,size]",NULL) },
	{ DDB_ADD_CMD("whatis",	db_whatis_cmd, 0,
	    "Describe what an address is", "address", NULL) },
	{ DDB_ADD_CMD("write",	db_write_cmd,		CS_MORE|CS_SET_DOT,
	    "Write the expressions at succeeding locations.",
	    "[/bhl] address expression [expression ...]",NULL) },
	{ DDB_ADD_CMD("x",		db_examine_cmd,		CS_SET_DOT,
	    "Display the address locations.",
	    "[/modifier] address[,count]",NULL) },
	{ DDB_ADD_CMD(NULL, 	NULL,		   0, NULL, NULL, NULL) }
};

static const struct db_command	*db_last_command = NULL;
#if defined(DDB_COMMANDONENTER)
char db_cmd_on_enter[DB_LINE_MAXLEN + 1] = ___STRING(DDB_COMMANDONENTER);
#else /* defined(DDB_COMMANDONENTER) */
char db_cmd_on_enter[DB_LINE_MAXLEN + 1] = "";
#endif /* defined(DDB_COMMANDONENTER) */
#define	DB_LINE_SEP	';'

/*
 * Execute commandlist after ddb start
 * This function goes through the command list created from commands and ';'
 */
static void
db_execute_commandlist(const char *cmdlist)
{
	const char *cmd = cmdlist;
	const struct db_command	*dummy = NULL;
Example #4
0
ATF_TC_HEAD(wait6_options, tc)
{
	atf_tc_set_md_var(tc, "descr",
	    "Test that wait6(2) returns ECHILD for P_ALL and option %s",
	    ___STRING(TWAIT_OPTION));
}