[Armadeus-commitlog] SF.net SVN: armadeus:[852] trunk/target/linux/modules
Brought to you by:
sszy
|
From: <ar...@us...> - 2008-07-23 20:57:29
|
Revision: 852
http://armadeus.svn.sourceforge.net/armadeus/?rev=852&view=rev
Author: artemys
Date: 2008-07-23 20:57:38 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
[LINUX] Add first version (without IT) of OpenCore 16550 serial IP driver
Modified Paths:
--------------
trunk/target/linux/modules/Makefile
trunk/target/linux/modules/fpga/Kconfig
Added Paths:
-----------
trunk/target/linux/modules/fpga/serial/
trunk/target/linux/modules/fpga/serial/16550.c
trunk/target/linux/modules/fpga/serial/Kconfig
trunk/target/linux/modules/fpga/serial/Makefile
trunk/target/linux/modules/fpga/serial/README
Modified: trunk/target/linux/modules/Makefile
===================================================================
--- trunk/target/linux/modules/Makefile 2008-07-23 12:51:25 UTC (rev 851)
+++ trunk/target/linux/modules/Makefile 2008-07-23 20:57:38 UTC (rev 852)
@@ -4,16 +4,18 @@
# Add your subdirectories to obj- target
#
-# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
+# Part executed when called from kernel build system:
+
obj-$(CONFIG_ARMADEUS_DRIVERS) += gpio/ pwm/ backlight/ isp1761/ \
fpga/ps2keyboard/ imxlkeypad/ fpga/fpga_devtools/ fpga/Wb_led/ fpga/Wb_button/ \
- fpga/i2ctest/ fpga/fpgaaccess/
+ fpga/i2ctest/ fpga/fpgaaccess/ fpga/serial/
-# Part execute when called from standard make in this directory:
else
+# Part executed when called from standard make in this directory:
+
BASE_DIR:=../../../buildroot/
REL:=$(shell grep "BR2_PACKAGE_LINUX_VERSION=" $(BASE_DIR).config | \
sed -e 's/BR2_PACKAGE_LINUX_VERSION=//' | sed -e 's/"//g')
Modified: trunk/target/linux/modules/fpga/Kconfig
===================================================================
--- trunk/target/linux/modules/fpga/Kconfig 2008-07-23 12:51:25 UTC (rev 851)
+++ trunk/target/linux/modules/fpga/Kconfig 2008-07-23 20:57:38 UTC (rev 852)
@@ -23,5 +23,7 @@
source "drivers/armadeus/fpga/fpgaaccess/Kconfig"
+source "drivers/armadeus/fpga/serial/Kconfig"
+
endmenu
Added: trunk/target/linux/modules/fpga/serial/16550.c
===================================================================
--- trunk/target/linux/modules/fpga/serial/16550.c (rev 0)
+++ trunk/target/linux/modules/fpga/serial/16550.c 2008-07-23 20:57:38 UTC (rev 852)
@@ -0,0 +1,78 @@
+/*
+ * Initialisation Driver for OpenCore 16550 serial IP
+ * loaded in FPGA of the Armadeus boards.
+ *
+ * (C) Copyright 2008 Armadeus Systems
+ * Author: Julien Boibessot <jul...@ar...>
+ *
+ * Inspired from Au1x00 Init from Pantelis Antoniou
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/module.h>
+#include <linux/serial_core.h>
+#include <linux/serial_8250.h>
+#include <linux/types.h>
+
+#include <asm/io.h> // readb()
+
+
+#define PORT(_base, _phys, _clock, _irq) \
+ { \
+ .membase = (void __iomem *)_base, \
+ .mapbase = _phys, \
+ .irq = _irq, \
+ .uartclk = _clock, \
+ .regshift = 1, \
+ .iotype = UPIO_MEM, \
+ .flags = UPF_BOOT_AUTOCONF \
+ }
+
+
+/* POD specific part */
+#define UART_INPUT_CLOCK 96000000
+#define UART1_BASE 0x10
+#define UART2_BASE 0x20
+#define UART1_IRQ APF9328_FPGA_IRQ
+#define UART2_IRQ APF9328_FPGA_IRQ
+/* End of POD specific part */
+
+
+static struct plat_serial8250_port ocore_16550_data[] = {
+ PORT( APF9328_FPGA_VIRT+UART1_BASE, APF9328_FPGA_PHYS+UART1_BASE, UART_INPUT_CLOCK, UART1_IRQ ),
+ PORT( APF9328_FPGA_VIRT+UART2_BASE, APF9328_FPGA_PHYS+UART2_BASE, UART_INPUT_CLOCK, UART2_IRQ ),
+ { },
+};
+
+static struct platform_device ocore_16550_device = {
+ .name = "serial8250", /* we use generic 8250/16550 Linux layer */
+ .id = PLAT8250_DEV_PLATFORM1,
+ .dev = {
+ .platform_data = ocore_16550_data,
+ },
+};
+
+static int __init ocore_16550_init(void)
+{
+ return platform_device_register( &ocore_16550_device );
+}
+
+static void __exit ocore_16550_exit(void)
+{
+ platform_device_unregister( &ocore_16550_device );
+}
+
+module_init(ocore_16550_init);
+module_exit(ocore_16550_exit);
+
+MODULE_AUTHOR("Julien Boibessot, <jul...@ar...>");
+MODULE_DESCRIPTION("8250 Linux layer registration module for 16550 OpenCore IP in Armadeus FPGA");
+MODULE_LICENSE("GPL");
Added: trunk/target/linux/modules/fpga/serial/Kconfig
===================================================================
--- trunk/target/linux/modules/fpga/serial/Kconfig (rev 0)
+++ trunk/target/linux/modules/fpga/serial/Kconfig 2008-07-23 20:57:38 UTC (rev 852)
@@ -0,0 +1,12 @@
+#
+#
+
+config ARMADEUS_FPGA_16550_OCORE
+ tristate "OpenCore 16550 serial IP driver"
+ default n
+ depends on ARMADEUS_FPGA_DRIVERS
+ ---help---
+ If you have the corresponding IP loaded in the FPGA then this
+ driver will allow you to use it by registering the serial ports
+ to the Linux 8250 serial layer.
+
Added: trunk/target/linux/modules/fpga/serial/Makefile
===================================================================
--- trunk/target/linux/modules/fpga/serial/Makefile (rev 0)
+++ trunk/target/linux/modules/fpga/serial/Makefile 2008-07-23 20:57:38 UTC (rev 852)
@@ -0,0 +1,35 @@
+#
+# Makefile for the Armadeus FPGA serial "driver" (compatible with 16550/8250 OpenCore IP)
+#
+
+ifneq ($(KERNELRELEASE),)
+
+# Part executed when called from kernel build system:
+
+obj-$(CONFIG_ARMADEUS_FPGA_16550_OCORE) += 16550_ocore.o
+16550_ocore-objs := 16550.o
+
+else
+
+# Part executed when called from standard make in this directory:
+# (preferably use Makefile in parent directory)
+
+BASE_DIR=../../../../../buildroot
+REL=`grep "BR2_PACKAGE_LINUX_VERSION=" $(BASE_DIR)/.config | \
+ sed "s/BR2_PACKAGE_LINUX_VERSION=\\"//" | sed "s/\\"//"`
+BUILD_ARM=`ls $(BASE_DIR) | grep "^build_arm"`
+ARMADEUS_KERNEL_DIR=$(BASE_DIR)/$(BUILD_ARM)/linux-$(REL)
+KDIR := $(ARMADEUS_KERNEL_DIR)
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
+clean:
+ rm -f *.*o
+ rm -f Module.symvers
+ rm -rf .*.cmd
+ rm -f *.mod.c
+
+endif
+
Property changes on: trunk/target/linux/modules/fpga/serial/Makefile
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/target/linux/modules/fpga/serial/README
===================================================================
--- trunk/target/linux/modules/fpga/serial/README (rev 0)
+++ trunk/target/linux/modules/fpga/serial/README 2008-07-23 20:57:38 UTC (rev 852)
@@ -0,0 +1,8 @@
+To compile this driver from here:
+---------------------------------
+ make ARCH=arm CROSS_COMPILE=$PWD/../../../../../buildroot/build_arm/staging_dir/bin/arm-linux-
+
+To install this driver:
+-----------------------
+Copy resulting *.ko files on your target rootfs
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|