From owner-p4-projects@FreeBSD.ORG Fri Jun 23 03:03:08 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93A4C16A4A5; Fri, 23 Jun 2006 03:03:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7240D16A481 for ; Fri, 23 Jun 2006 03:03:08 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74F94458A6 for ; Thu, 22 Jun 2006 22:06:26 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5MM6QqG017129 for ; Thu, 22 Jun 2006 22:06:26 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5MM6Q0A017125 for perforce@freebsd.org; Thu, 22 Jun 2006 22:06:26 GMT (envelope-from imp@freebsd.org) Date: Thu, 22 Jun 2006 22:06:26 GMT Message-Id: <200606222206.k5MM6Q0A017125@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 99836 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2006 03:03:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=99836 Change 99836 by imp@imp_lighthouse on 2006/06/22 22:06:24 Attempt peripheral config for the KB9202 and TSC board. We'll need to cope with divergence soon... Affected files ... .. //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#25 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#25 (text+ko) ==== @@ -93,6 +93,8 @@ #include #include +#include +#include #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_KERN 1 @@ -183,11 +185,11 @@ #endif static long -board_init(void) +ramsize(void) { uint32_t *SDRAMC = (uint32_t *)(AT91RM92_BASE + AT91RM92_SDRAMC_BASE); uint32_t cr, mr; - int banks, rows, cols, bw; /* log2 size */ + int banks, rows, cols, bw; cr = SDRAMC[AT91RM92_SDRAMC_CR / 4]; mr = SDRAMC[AT91RM92_SDRAMC_MR / 4]; @@ -198,6 +200,29 @@ return (1 << (cols + rows + banks + bw)); } +static long +board_init(void) +{ + /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA17_TXD0 | AT91C_PA18_RXD0 | + AT91C_PA23_TXD2 | AT91C_PA22_RXD2); + /* PIOA's B periph: Turn USART 3's TX/RX pins */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, + AT91C_PA5_TXD3 | AT91C_PA6_RXD3); + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, + AT91C_PB20_TXD1 | AT91C_PB21_RXD1); + + /* Pin assignment */ + /* Assert PA24 low -- talk to rubidium */ + at91_pio_use_gpio(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); + at91_pio_gpio_output(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); + at91_pio_gpio_clear(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); + + return (ramsize()); +} + void * initarm(void *arg, void *arg2) { @@ -431,6 +456,7 @@ init_param2(physmem); avail_end = KERNPHYSADDR + memsize - 1; kdb_init(); + printf("Args: %p %p\n", arg, arg2); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); }