summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-05-14 23:17:33 +0000
committerian <ian@FreeBSD.org>2014-05-14 23:17:33 +0000
commit1a08ef9120500189667e1d4142779b31622fb643 (patch)
tree818042a063c190f79a3d4c717ec3aa6b7bc96cfe
parent393ed120ae54ade20f39ff2e4182685fc0324b23 (diff)
downloadFreeBSD-src-1a08ef9120500189667e1d4142779b31622fb643.zip
FreeBSD-src-1a08ef9120500189667e1d4142779b31622fb643.tar.gz
MFC r261083, r261092, r261126, r261127, r261128, r261129, r261130, r261131
Add Atmel serial drivers. uart clock-frequency is a FreeBSD-specific extention. Make it optional and allow the client uart drivers to decide if a frequency is required. Remove redundant declaration for uart devclass. Commit some unrelated, but harmless, FDT ifdefs. Add at91 NAND support, Fix comment. Remove obsolete options and fix comments
-rw-r--r--sys/arm/at91/uart_bus_at91usart.c2
-rw-r--r--sys/arm/at91/uart_cpu_at91usart.c4
-rw-r--r--sys/arm/conf/BWCT2
-rw-r--r--sys/arm/conf/HL2002
-rw-r--r--sys/arm/conf/QILA9G203
-rw-r--r--sys/arm/conf/SAM9G20EK14
-rw-r--r--sys/arm/conf/SAM9X25EK3
-rw-r--r--sys/arm/conf/SN9G453
-rw-r--r--sys/dev/uart/uart.h1
-rw-r--r--sys/dev/uart/uart_bus_fdt.c2
-rw-r--r--sys/dev/uart/uart_cpu_fdt.c3
11 files changed, 21 insertions, 18 deletions
diff --git a/sys/arm/at91/uart_bus_at91usart.c b/sys/arm/at91/uart_bus_at91usart.c
index 98cde1d..65829df 100644
--- a/sys/arm/at91/uart_bus_at91usart.c
+++ b/sys/arm/at91/uart_bus_at91usart.c
@@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
static int usart_at91_probe(device_t dev);
-extern struct uart_class at91_usart_class;
-
static device_method_t usart_at91_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, usart_at91_probe),
diff --git a/sys/arm/at91/uart_cpu_at91usart.c b/sys/arm/at91/uart_cpu_at91usart.c
index 33b5621..67a0a05 100644
--- a/sys/arm/at91/uart_cpu_at91usart.c
+++ b/sys/arm/at91/uart_cpu_at91usart.c
@@ -26,8 +26,10 @@
* SUCH DAMAGE.
*/
+#include "opt_platform.h"
#include "opt_uart.h"
+#ifndef FDT
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -48,7 +50,6 @@ __FBSDID("$FreeBSD$");
bus_space_tag_t uart_bus_space_io;
bus_space_tag_t uart_bus_space_mem;
-extern struct uart_class at91_usart_class;
extern struct bus_space at91_bs_tag;
int
@@ -86,3 +87,4 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
uart_getenv(devtype, di, class);
return (0);
}
+#endif
diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT
index 314ff90..f23e189 100644
--- a/sys/arm/conf/BWCT
+++ b/sys/arm/conf/BWCT
@@ -41,7 +41,7 @@ options SOFTUPDATES #Enable FFS soft updates support
#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 # 4MB ram disk
#options ROOTDEVNAME=\"ufs:md0\"
#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\"
options NFSCL #New Network Filesystem Client
diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200
index 43760d6..db59b87 100644
--- a/sys/arm/conf/HL200
+++ b/sys/arm/conf/HL200
@@ -37,7 +37,7 @@ 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 # 4MB ram disk
#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\"
options NFSCL #New Network Filesystem Client
#options NFSD #New Network Filesystem Server
diff --git a/sys/arm/conf/QILA9G20 b/sys/arm/conf/QILA9G20
index b399fcd..adb1355 100644
--- a/sys/arm/conf/QILA9G20
+++ b/sys/arm/conf/QILA9G20
@@ -38,7 +38,7 @@ 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 # 4MB ram disk
options NFSCL #New Network Filesystem Client
#options NFSD #New Network Filesystem Server
#options NFSLOCKD #Network Lock Manager
@@ -63,7 +63,6 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options SYSCTL_OMIT_DESCR
options MUTEX_NOINLINE
options RWLOCK_NOINLINE
options NO_FFS_SNAPSHOT
diff --git a/sys/arm/conf/SAM9G20EK b/sys/arm/conf/SAM9G20EK
index 9a3921d..628c007 100644
--- a/sys/arm/conf/SAM9G20EK
+++ b/sys/arm/conf/SAM9G20EK
@@ -37,7 +37,8 @@ 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 # 4MB ram disk
+options NANDFS #NAND file system
options NFSCL #New Network Filesystem Client
#options NFSD #New Network Filesystem Server
#options NFSLOCKD #Network Lock Manager
@@ -62,7 +63,6 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options SYSCTL_OMIT_DESCR
options MUTEX_NOINLINE
options RWLOCK_NOINLINE
options NO_FFS_SNAPSHOT
@@ -91,6 +91,9 @@ option AT91_ATE_USE_RMII
device at91_twi # TWI: Two Wire Interface (EEPROM)
device at91_wdt # WDT: Watchdog timer
+# NAND Flash - Reference design has Samsung 256MB but others possible
+device nand # NAND interface on CS3
+
# NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware
# confilict on this card. Use one or the other.
# see board_sam9g20ek.c
@@ -105,7 +108,7 @@ device at91_mci
device mmc
device mmcsd
option AT91_MCI_SLOT_B
-#option AT91_MCI_HAS_4WIRE
+option AT91_MCI_HAS_4WIRE
# iic
device iic
@@ -128,14 +131,14 @@ device uhid # "Human Interface Devices"
#device udbp # USB Double Bulk Pipe devices
# USB Ethernet, requires miibus
-device miibus
+#device miibus
#device aue # ADMtek USB Ethernet
#device axe # ASIX Electronics USB Ethernet
#device cdce # Generic USB over Ethernet
#device cue # CATC USB Ethernet
#device kue # Kawasaki LSI USB Ethernet
#device rue # RealTek RTL8150 USB Ethernet
-device udav # Davicom DM9601E USB
+#device udav # Davicom DM9601E USB
# USB Wireless
#device rum # Ralink Technology RT2501USB wireless NICs
@@ -149,4 +152,3 @@ device udav # Davicom DM9601E USB
#device wlan_ccmp # 802.11 CCMP support
#device wlan_tkip # 802.11 TKIP support
#device wlan_amrr # AMRR transmit rate control algorithm
-
diff --git a/sys/arm/conf/SAM9X25EK b/sys/arm/conf/SAM9X25EK
index a9bf42c..5c9245a 100644
--- a/sys/arm/conf/SAM9X25EK
+++ b/sys/arm/conf/SAM9X25EK
@@ -38,7 +38,7 @@ 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 # 4MB ram disk
options NFSCL #New Network Filesystem Client
#options NFSD #New Network Filesystem Server
#options NFSLOCKD #Network Lock Manager
@@ -63,7 +63,6 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options SYSCTL_OMIT_DESCR
options MUTEX_NOINLINE
options RWLOCK_NOINLINE
options NO_FFS_SNAPSHOT
diff --git a/sys/arm/conf/SN9G45 b/sys/arm/conf/SN9G45
index 41338dd..60c4ae5 100644
--- a/sys/arm/conf/SN9G45
+++ b/sys/arm/conf/SN9G45
@@ -37,7 +37,7 @@ 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 # 4MB ram disk
options NFSCL #New Network Filesystem Client
#options NFSD #New Network Filesystem Server
#options NFSLOCKD #Network Lock Manager
@@ -62,7 +62,6 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options SYSCTL_OMIT_DESCR
options MUTEX_NOINLINE
options RWLOCK_NOINLINE
options NO_FFS_SNAPSHOT
diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h
index 4874488..0bcedde 100644
--- a/sys/dev/uart/uart.h
+++ b/sys/dev/uart/uart.h
@@ -76,6 +76,7 @@ extern struct uart_class uart_pl011_class __attribute__((weak));
extern struct uart_class uart_cdnc_class __attribute__((weak));
extern struct uart_class uart_ti8250_class __attribute__((weak));
extern struct uart_class uart_vybrid_class __attribute__((weak));
+extern struct uart_class at91_usart_class __attribute__((weak));
#ifdef FDT
struct ofw_compat_data;
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c
index a98c50a..3630b9c 100644
--- a/sys/dev/uart/uart_bus_fdt.c
+++ b/sys/dev/uart/uart_bus_fdt.c
@@ -71,6 +71,8 @@ static driver_t uart_fdt_driver = {
*/
static struct ofw_compat_data compat_data[] = {
{"arm,pl011", (uintptr_t)&uart_pl011_class},
+ {"atmel,at91rm9200-usart",(uintptr_t)&at91_usart_class},
+ {"atmel,at91sam9260-usart",(uintptr_t)&at91_usart_class},
{"cadence,uart", (uintptr_t)&uart_cdnc_class},
{"exynos", (uintptr_t)&uart_s3c2410_class},
{"fsl,imx6q-uart", (uintptr_t)&uart_imx_class},
diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c
index 9bf3549..356049b 100644
--- a/sys/dev/uart/uart_cpu_fdt.c
+++ b/sys/dev/uart/uart_cpu_fdt.c
@@ -62,9 +62,10 @@ uart_fdt_get_clock(phandle_t node, pcell_t *cell)
{
pcell_t clock;
+ /* clock-frequency is a FreeBSD-only extention. */
if ((OF_getprop(node, "clock-frequency", &clock,
sizeof(clock))) <= 0)
- return (ENXIO);
+ clock = 0;
if (clock == 0)
/* Try to retrieve parent 'bus-frequency' */
OpenPOWER on IntegriCloud