From 7558f3d5f0a332e007641a69ecac2d949aff1670 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 25 Nov 2008 19:05:46 +0000 Subject: Convert BWCT and HL200 over to new board mechanism as well. The TSC4370 config file wasn't committed to this tree, so I don't know if my changes will work on it or not. --- sys/arm/at91/board_bwct.c | 66 ++++++++++++++++++++++++++++++++++++++ sys/arm/at91/board_hl200.c | 63 +++++++++++++++++++++++++++++++++++++ sys/arm/at91/board_kb920x.c | 18 ----------- sys/arm/at91/board_tsc4370.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ sys/arm/at91/files.at91 | 2 ++ sys/arm/at91/std.bwct | 10 ++++++ sys/arm/at91/std.hl200 | 11 +++++++ sys/arm/at91/std.kb920x | 2 +- sys/arm/at91/std.tsc4370 | 10 ++++++ sys/arm/conf/BWCT | 2 +- sys/arm/conf/HL200 | 52 +++++++++++++----------------- 11 files changed, 260 insertions(+), 51 deletions(-) create mode 100644 sys/arm/at91/board_bwct.c create mode 100644 sys/arm/at91/board_hl200.c create mode 100644 sys/arm/at91/board_tsc4370.c create mode 100644 sys/arm/at91/std.bwct create mode 100644 sys/arm/at91/std.hl200 create mode 100644 sys/arm/at91/std.tsc4370 diff --git a/sys/arm/at91/board_bwct.c b/sys/arm/at91/board_bwct.c new file mode 100644 index 000000000000..d82ffc1c2b52 --- /dev/null +++ b/sys/arm/at91/board_bwct.c @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. + * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include + +long +board_init(void) +{ + /* + * Since the USART supports RS-485 multidrop mode, it allows the + * TX pins to float. However, for RS-232 operations, we don't want + * these pins to float. Instead, they should be pulled up to avoid + * mismatches. Linux does something similar when it configures the + * TX lines. This implies that we also allow the RX lines to float + * rather than be in the state they are left in by the boot loader. + * Since they are input pins, I think that this is the right thing + * to do. + */ + + /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); + /* PIOA's B periph: Turn USART 3's TX/RX pins */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + + /* Pin assignment */ + + return (at91_ramsize()); +} diff --git a/sys/arm/at91/board_hl200.c b/sys/arm/at91/board_hl200.c new file mode 100644 index 000000000000..f1a24394f540 --- /dev/null +++ b/sys/arm/at91/board_hl200.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. + * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include + +long +board_init(void) +{ + /* + * Since the USART supports RS-485 multidrop mode, it allows the + * TX pins to float. However, for RS-232 operations, we don't want + * these pins to float. Instead, they should be pulled up to avoid + * mismatches. Linux does something similar when it configures the + * TX lines. This implies that we also allow the RX lines to float + * rather than be in the state they are left in by the boot loader. + * Since they are input pins, I think that this is the right thing + * to do. + */ + /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); + /* PIOA's B periph: Turn USART 3's TX/RX pins */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + + return (at91_ramsize()); +} diff --git a/sys/arm/at91/board_kb920x.c b/sys/arm/at91/board_kb920x.c index a8104fc434e6..f1a24394f540 100644 --- a/sys/arm/at91/board_kb920x.c +++ b/sys/arm/at91/board_kb920x.c @@ -24,8 +24,6 @@ * SUCH DAMAGE. */ -#include "opt_at91.h" - #include __FBSDID("$FreeBSD$"); #include @@ -49,7 +47,6 @@ board_init(void) * Since they are input pins, I think that this is the right thing * to do. */ - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); @@ -58,24 +55,9 @@ board_init(void) /* PIOA's B periph: Turn USART 3's TX/RX pins */ at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); -#ifdef AT91_TSC - /* We're using TC0's A1 and A2 input */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, - AT91C_PA19_TIOA1 | AT91C_PA21_TIOA2, 0); -#endif /* PIOB's A periph: Turn USART 1's TX/RX pins */ at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); - /* Pin assignment */ -#ifdef AT91_TSC - /* 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, 0); - at91_pio_gpio_clear(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); - at91_pio_use_gpio(AT91RM92_PIOB_BASE, - AT91C_PIO_PB16 | AT91C_PIO_PB17 | AT91C_PIO_PB18 | AT91C_PIO_PB19); -#endif - return (at91_ramsize()); } diff --git a/sys/arm/at91/board_tsc4370.c b/sys/arm/at91/board_tsc4370.c new file mode 100644 index 000000000000..6529eb8b7da9 --- /dev/null +++ b/sys/arm/at91/board_tsc4370.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. + * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include + +long +board_init(void) +{ + /* + * Since the USART supports RS-485 multidrop mode, it allows the + * TX pins to float. However, for RS-232 operations, we don't want + * these pins to float. Instead, they should be pulled up to avoid + * mismatches. Linux does something similar when it configures the + * TX lines. This implies that we also allow the RX lines to float + * rather than be in the state they are left in by the boot loader. + * Since they are input pins, I think that this is the right thing + * to do. + */ + + /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, + AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); + /* PIOA's B periph: Turn USART 3's TX/RX pins */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); + /* We're using TC0's A1 and A2 input */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, + AT91C_PA19_TIOA1 | AT91C_PA21_TIOA2, 0); + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + + /* 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, 0); + at91_pio_gpio_clear(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); + at91_pio_use_gpio(AT91RM92_PIOB_BASE, + AT91C_PIO_PB16 | AT91C_PIO_PB17 | AT91C_PIO_PB18 | AT91C_PIO_PB19); + + return (at91_ramsize()); +} diff --git a/sys/arm/at91/files.at91 b/sys/arm/at91/files.at91 index d3d729174f2d..108e67ab5485 100644 --- a/sys/arm/at91/files.at91 +++ b/sys/arm/at91/files.at91 @@ -22,5 +22,7 @@ arm/at91/uart_dev_at91usart.c optional uart # # All the boards we support # +arm/at91/board_bwct.c optional at91_board_bwct +arm/at91/board_hl200.c optional at91_board_hl200 arm/at91/board_kb920x.c optional at91_board_kb920x arm/at91/board_tsc4370.c optional at91_board_tsc4370 diff --git a/sys/arm/at91/std.bwct b/sys/arm/at91/std.bwct new file mode 100644 index 000000000000..6cb7dddf51fe --- /dev/null +++ b/sys/arm/at91/std.bwct @@ -0,0 +1,10 @@ +#$FreeBSD$ +include "../at91/std.at91" + +options STARTUP_PAGETABLE_ADDR=0x20800000 +makeoptions KERNPHYSADDR=0x20000000 +options KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNVIRTADDR=0xc0000000 + +device at91_board_bwct diff --git a/sys/arm/at91/std.hl200 b/sys/arm/at91/std.hl200 new file mode 100644 index 000000000000..3f99b49be88a --- /dev/null +++ b/sys/arm/at91/std.hl200 @@ -0,0 +1,11 @@ +#$FreeBSD$ +include "../at91/std.at91" + +options STARTUP_PAGETABLE_ADDR=0x20000000 +makeoptions KERNPHYSADDR=0x20100000 +options KERNPHYSADDR=0x20100000 +makeoptions KERNVIRTADDR=0xc0100000 +options KERNVIRTADDR=0xc0100000 +options AT91C_MASTER_CLOCK=45000000 + +device at91_board_hl200 diff --git a/sys/arm/at91/std.kb920x b/sys/arm/at91/std.kb920x index b75c28cb0be3..85c8d038bf7b 100644 --- a/sys/arm/at91/std.kb920x +++ b/sys/arm/at91/std.kb920x @@ -3,8 +3,8 @@ include "../at91/std.at91" options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 -makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 device at91_board_kb920x diff --git a/sys/arm/at91/std.tsc4370 b/sys/arm/at91/std.tsc4370 new file mode 100644 index 000000000000..6c08f8cd6ce2 --- /dev/null +++ b/sys/arm/at91/std.tsc4370 @@ -0,0 +1,10 @@ +#$FreeBSD$ +include "../at91/std.at91" + +options STARTUP_PAGETABLE_ADDR=0x20800000 +makeoptions KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNPHYSADDR=0x20000000 +options KERNVIRTADDR=0xc0000000 + +device at91_board_tsc4370 diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT index 1c18f7ba822b..f60f8da90ef6 100644 --- a/sys/arm/conf/BWCT +++ b/sys/arm/conf/BWCT @@ -22,7 +22,7 @@ ident BWCT options VERBOSE_INIT_ARM options AT91_BWCT -include "../at91/std.kb920x" +include "../at91/std.bwct" #To statically compile in device wiring instead of /boot/device.hints #hints "hints.at91rm9200" diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200 index b07f9cf70361..0a43ab2b18ea 100644 --- a/sys/arm/conf/HL200 +++ b/sys/arm/conf/HL200 @@ -1,5 +1,4 @@ -# KB920X -- Custom kernel configuration for the KB9200, 9201 and 9202 -# AT91RM9200 based Hot-e configuration file +# Kernel configuration for the AT91RM9200 based Hot-e configuration file # # For more information on this file, please read the handbook section on # Kernel Configuration Files: @@ -20,23 +19,14 @@ ident HL200 -include "../at91/std.at91" -files "../at91/files.kb920x" - -options STARTUP_PAGETABLE_ADDR=0x20000000 -makeoptions KERNPHYSADDR=0x20100000 -makeoptions KERNVIRTADDR=0xc0100000 -options KERNPHYSADDR=0x20100000 -options KERNVIRTADDR=0xc0100000 +include "../at91/std.hl200" #To statically compile in device wiring instead of /boot/device.hints -#hints "GENERIC.hints" #Default places to look for devices. hints "KB920X.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB options KDB -options AT91C_MASTER_CLOCK=45000000 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking @@ -46,17 +36,17 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 3MB ram disk #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server #options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options BOOTP_NFSROOT -options BOOTP -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT +options BOOTP_NFSROOT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 +options BOOTP_COMPAT #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem @@ -124,20 +114,20 @@ device kue # Kawasaki LSI USB Ethernet device rue # RealTek RTL8150 USB Ethernet device udav # usb serial -device ucom -device uark -device ubsa -device ubser -device uftdi -device uipaq -device uplcom -device uvisor -device uvscom +device ucom +device uark +device ubsa +#device ubser # not yet converted. +device uftdi +device uipaq +device uplcom +device uvisor +device uvscom # SCSI peripherals -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct SCSI access) +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) # Wireless NIC cards device wlan # 802.11 support device wlan_wep # 802.11 WEP support -- cgit v1.2.3