Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2012 11:23:38 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r237386 - in stable/9/sys/arm: at91 conf
Message-ID:  <201206211123.q5LBNcne009676@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Thu Jun 21 11:23:38 2012
New Revision: 237386
URL: http://svn.freebsd.org/changeset/base/237386

Log:
  MFC: r235348, r236191, r236497
  
  Add glue/support for the SAM9XE512-based Ethernut 5 boards. Currently,
  all integrated and on-board peripherals except NAND Flash (missing NAND
  framework/integration) are working.

Added:
  stable/9/sys/arm/at91/board_ethernut5.c
     - copied unchanged from r235348, head/sys/arm/at91/board_ethernut5.c
  stable/9/sys/arm/at91/std.ethernut5
     - copied unchanged from r235348, head/sys/arm/at91/std.ethernut5
  stable/9/sys/arm/conf/ETHERNUT5
     - copied, changed from r235348, head/sys/arm/conf/ETHERNUT5
  stable/9/sys/arm/conf/ETHERNUT5.hints
     - copied, changed from r235348, head/sys/arm/conf/ETHERNUT5.hints
Modified:
  stable/9/sys/arm/at91/files.at91sam9
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Copied: stable/9/sys/arm/at91/board_ethernut5.c (from r235348, head/sys/arm/at91/board_ethernut5.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/arm/at91/board_ethernut5.c	Thu Jun 21 11:23:38 2012	(r237386, copy of r235348, head/sys/arm/at91/board_ethernut5.c)
@@ -0,0 +1,146 @@
+/*-
+ * Copyright (c) 2012 Marius Strobl <marius@FreeBSD.org>
+ * 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 THE 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 THE 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.
+ */
+
+/*
+ * Ethernut 5 board support
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <arm/at91/at91_pioreg.h>
+#include <arm/at91/at91_piovar.h>
+#include <arm/at91/at91board.h>
+#include <arm/at91/at91sam9260reg.h>
+
+long
+board_init(void)
+{
+
+	/*
+	 * DBGU
+	 */
+	/* DRXD */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB14, 0);
+	/* DTXD */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB15, 1);
+
+	/*
+	 * EMAC
+	 */
+	/* ETX0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA12, 0);
+	/* ETX1 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA13, 0);
+	/* ERX0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA14, 0);
+	/* ERX1 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA15, 0);
+	/* ETXEN */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA16, 0);
+	/* ERXDV */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA17, 0);
+	/* ERXER */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA18, 0);
+	/* ETXCK */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA19, 0);
+	/* EMDC */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA20, 0);
+	/* EMDIO */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA21, 0);
+
+	/*
+	 * MMC
+	 */
+	/* MCDA0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA6, 1);
+	/* MCCDA */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA7, 1);
+	/* MCCK */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA8, 1);
+	/* MCDA1 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA9, 1);
+	/* MCDA2 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA10, 1);
+	/* MCDA3 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA11, 1);
+
+	/*
+	 * SPI0
+	 */
+	/* MISO */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA0, 0);
+	/* MOSI */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA1, 0);
+	/* SPCK */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA2, 0);
+	/* NPCS0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA3, 0);
+
+	/*
+	 * TWI
+	 */
+	/* TWD */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA23, 1);
+	/* TWCK */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA24, 1);
+
+	/*
+	 * USART0
+	 */
+	/* TXD0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB4, 1);
+	/* RXD0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB5, 0);
+	/* DSR0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB22, 0);
+	/* DCD0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB23, 0);
+	/* DTR0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB24, 1);
+	/* RI0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB25, 0);
+	/* RTS0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB26, 1);
+	/* CTS0 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB27, 0);
+
+	/*
+	 * USART2
+	 */
+	/* RTS2 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA4, 1);
+	/* CTS2 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA5, 0);
+	/* TXD2 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB8, 1);
+	/* RXD2 */
+	at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB9, 0);
+
+	return (at91_ramsize());
+}

Modified: stable/9/sys/arm/at91/files.at91sam9
==============================================================================
--- stable/9/sys/arm/at91/files.at91sam9	Thu Jun 21 11:16:13 2012	(r237385)
+++ stable/9/sys/arm/at91/files.at91sam9	Thu Jun 21 11:23:38 2012	(r237386)
@@ -31,6 +31,7 @@ arm/at91/at91sam9260.c		optional	at91sam
 #
 # All the boards we support
 #
+arm/at91/board_ethernut5.c	optional	at91_board_ethernut5
 arm/at91/board_hl201.c		optional	at91_board_hl201
 arm/at91/board_sam9g20ek.c	optional	at91_board_sam9g20ek
 arm/at91/board_qila9g20.c	optional	at91_board_qila9g20

Copied: stable/9/sys/arm/at91/std.ethernut5 (from r235348, head/sys/arm/at91/std.ethernut5)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/arm/at91/std.ethernut5	Thu Jun 21 11:23:38 2012	(r237386, copy of r235348, head/sys/arm/at91/std.ethernut5)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+include "../at91/std.at91sam9"
+
+options 	STARTUP_PAGETABLE_ADDR=0x20800000
+makeoptions	KERNPHYSADDR=0x20000000
+makeoptions	KERNVIRTADDR=0xc0000000
+options 	KERNPHYSADDR=0x20000000
+options 	KERNVIRTADDR=0xc0000000
+
+# SAM9XE512 w/ 90.3168 MHz master clock
+options 	AT91C_MASTER_CLOCK=90316800
+
+device		at91_board_ethernut5
+nodevice	at91sam9g20

Copied and modified: stable/9/sys/arm/conf/ETHERNUT5 (from r235348, head/sys/arm/conf/ETHERNUT5)
==============================================================================
--- head/sys/arm/conf/ETHERNUT5	Sat May 12 18:11:26 2012	(r235348, copy source)
+++ stable/9/sys/arm/conf/ETHERNUT5	Thu Jun 21 11:23:38 2012	(r237386)
@@ -66,11 +66,11 @@ options 	PRINTF_BUFR_SIZE=128	# Prevent 
 #options 	INCLUDE_CONFIG_FILE	# Include this file in kernel
 
 # required for netbooting
-options 	BOOTP_NFSROOT
 options 	BOOTP
+options 	BOOTP_COMPAT
+options 	BOOTP_NFSROOT
 options 	BOOTP_NFSV3
 options 	BOOTP_WIRED_TO=ate0
-options 	BOOTP_COMPAT
 
 # alternatively, boot from a MMC/SD memory card
 #options 	ROOTDEVNAME=\"ufs:/dev/mmcsd0a\"
@@ -117,11 +117,11 @@ options 	AT91_MCI_HAS_4WIRE
 device		mmc		# MMC/SD bus
 device		mmcsd		# MMC/SD memory card
 
-# DataFlash - totally b0rken drivers
-#device		at91_spi	# Atmel AT91 Serial Peripheral Interface
-#device		spibus		# SPI bus
-#device		at45d		# Atmel AT45D
-#device		geom_map	# GEOM partition mapping
+# DataFlash
+device		at91_spi	# Atmel AT91 Serial Peripheral Interface
+device		spibus		# SPI bus
+device		at45d		# Atmel AT45D
+device		geom_map	# GEOM partition mapping
 
 # Pseudo devices.
 device		loop		# Network loopback

Copied and modified: stable/9/sys/arm/conf/ETHERNUT5.hints (from r235348, head/sys/arm/conf/ETHERNUT5.hints)
==============================================================================
--- head/sys/arm/conf/ETHERNUT5.hints	Sat May 12 18:11:26 2012	(r235348, copy source)
+++ stable/9/sys/arm/conf/ETHERNUT5.hints	Thu Jun 21 11:23:38 2012	(r237386)
@@ -27,18 +27,24 @@ hint.map.3.start=0x000c6000
 hint.map.3.end=0x00359fff
 hint.map.3.name="kernel"
 #hint.map.3.readonly=1
-# nutos 3432 kbytes
+# nutos 528 kbytes
 hint.map.4.at="flash/spi0"
 hint.map.4.start=0x0035a000
 hint.map.4.end=0x003ddfff
 hint.map.4.name="nutos"
 hint.map.4.readonly=1
-# env 3960 kbytes
+# env 132 kbytes
 hint.map.5.at="flash/spi0"
 hint.map.5.start=0x003de000
 hint.map.5.end=0x003fefff
 hint.map.5.name="env"
 hint.map.5.readonly=1
+# env 132 kbytes
+hint.map.6.at="flash/spi0"
+hint.map.6.start=0x003ff000
+hint.map.6.end=0x0041ffff
+hint.map.6.name="nutoscfg"
+hint.map.6.readonly=1
 
 # NXP PCF8563 clock/calendar
 hint.pcf8563_rtc.0.at="iicbus0"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206211123.q5LBNcne009676>