PERFORCE change 99836 for review
Warner Losh
imp at FreeBSD.org
Fri Jun 23 03:03:08 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99836
Change 99836 by imp at 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 <sys/reboot.h>
#include <arm/at91/at91rm92reg.h>
+#include <arm/at91/at91_piovar.h>
+#include <arm/at91/at91_pio_rm9200.h>
#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)));
}
More information about the p4-projects
mailing list