armadeus-commitlog Mailing List for armadeus (Page 93)
Brought to you by:
sszy
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(43) |
Feb
(8) |
Mar
(7) |
Apr
(8) |
May
(14) |
Jun
(6) |
Jul
(4) |
Aug
(17) |
Sep
(18) |
Oct
(19) |
Nov
(52) |
Dec
(30) |
| 2008 |
Jan
(6) |
Feb
(6) |
Mar
(15) |
Apr
(22) |
May
(13) |
Jun
(11) |
Jul
(41) |
Aug
(10) |
Sep
(14) |
Oct
(21) |
Nov
(4) |
Dec
(66) |
| 2009 |
Jan
(67) |
Feb
(57) |
Mar
(90) |
Apr
(54) |
May
(64) |
Jun
(76) |
Jul
(14) |
Aug
(18) |
Sep
(18) |
Oct
(20) |
Nov
(15) |
Dec
(36) |
| 2010 |
Jan
(28) |
Feb
(25) |
Mar
(32) |
Apr
(23) |
May
(22) |
Jun
(62) |
Jul
(36) |
Aug
(16) |
Sep
(12) |
Oct
(20) |
Nov
(44) |
Dec
(25) |
| 2011 |
Jan
(36) |
Feb
(49) |
Mar
(28) |
Apr
(38) |
May
(26) |
Jun
(52) |
Jul
(33) |
Aug
(32) |
Sep
(19) |
Oct
(26) |
Nov
(13) |
Dec
(32) |
| 2012 |
Jan
(38) |
Feb
(34) |
Mar
(91) |
Apr
(35) |
May
(31) |
Jun
(72) |
Jul
(23) |
Aug
(13) |
Sep
(33) |
Oct
(47) |
Nov
(18) |
Dec
(22) |
| 2013 |
Jan
(31) |
Feb
(22) |
Mar
(26) |
Apr
(11) |
May
(38) |
Jun
(15) |
Jul
(37) |
Aug
(68) |
Sep
(34) |
Oct
(11) |
Nov
(26) |
Dec
(31) |
| 2014 |
Jan
(60) |
Feb
(55) |
Mar
(21) |
Apr
(31) |
May
(17) |
Jun
(35) |
Jul
(24) |
Aug
(17) |
Sep
(11) |
Oct
(23) |
Nov
(10) |
Dec
(23) |
| 2015 |
Jan
(15) |
Feb
(34) |
Mar
(46) |
Apr
(23) |
May
(12) |
Jun
(14) |
Jul
(18) |
Aug
(22) |
Sep
(6) |
Oct
(2) |
Nov
(1) |
Dec
(6) |
| 2016 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
(10) |
May
(17) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
(22) |
Oct
(8) |
Nov
(9) |
Dec
(5) |
| 2017 |
Jan
(11) |
Feb
(12) |
Mar
(27) |
Apr
(9) |
May
(1) |
Jun
(5) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
(10) |
Nov
(4) |
Dec
(6) |
| 2018 |
Jan
(6) |
Feb
(13) |
Mar
(9) |
Apr
(7) |
May
(10) |
Jun
(9) |
Jul
(21) |
Aug
(13) |
Sep
(10) |
Oct
(4) |
Nov
(6) |
Dec
(1) |
| 2019 |
Jan
(6) |
Feb
(2) |
Mar
(5) |
Apr
(6) |
May
(19) |
Jun
(14) |
Jul
(18) |
Aug
(3) |
Sep
(5) |
Oct
(7) |
Nov
(8) |
Dec
(4) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(9) |
Apr
(7) |
May
(2) |
Jun
(18) |
Jul
(3) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
| 2021 |
Jan
(9) |
Feb
(6) |
Mar
(4) |
Apr
(11) |
May
(7) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(10) |
Oct
(9) |
Nov
(5) |
Dec
|
| 2022 |
Jan
(2) |
Feb
(12) |
Mar
(3) |
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(4) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2023 |
Jan
(5) |
Feb
(3) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(1) |
Jun
(13) |
Jul
(7) |
Aug
(1) |
Sep
(6) |
Oct
(5) |
Nov
(11) |
Dec
(7) |
| 2025 |
Jan
(3) |
Feb
(1) |
Mar
(6) |
Apr
(4) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(4) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2026 |
Jan
(3) |
Feb
(7) |
Mar
(3) |
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: jorasse <jo...@us...> - 2011-05-31 22:33:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 172366eb5b5f10c9299f95af6af8fc520f2914e7 (commit)
from b48be9575ae35d8ac8458566fe73d6f9a4b2ab33 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 172366eb5b5f10c9299f95af6af8fc520f2914e7
Author: jorasse <jo...@ar...>
Date: Wed Jun 1 00:35:59 2011 +0200
[LINUX] apf51: enable power key events
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index 0fbd4d9..dbcea01 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Thu May 12 11:42:55 2011
+# Wed Jun 1 00:30:41 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1049,7 +1049,7 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=m
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
-# CONFIG_INPUT_WM831X_ON is not set
+CONFIG_INPUT_WM831X_ON=y
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_CMA3000 is not set
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2011-05-31 22:25:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via b48be9575ae35d8ac8458566fe73d6f9a4b2ab33 (commit)
via 83ca20c6795363c97bfd531bf8095da60c3859e9 (commit)
via 613faa1c6ee38a891279897f98bbeacc68cee96f (commit)
from 00aa4d97ab660d9b14063aaa8ec0f3d038010ac8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b48be9575ae35d8ac8458566fe73d6f9a4b2ab33
Author: jorasse <jo...@ar...>
Date: Tue May 31 23:52:14 2011 +0200
[BUILDROOT] Fix parallel build issue
commit 83ca20c6795363c97bfd531bf8095da60c3859e9
Author: jorasse <jo...@ar...>
Date: Tue May 31 23:40:32 2011 +0200
[LINUX] apf51: add freescale PM (preliminary version)
commit 613faa1c6ee38a891279897f98bbeacc68cee96f
Author: jorasse <jo...@ar...>
Date: Tue May 31 23:39:17 2011 +0200
[LINUX] apf51: support user switch
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 20 ++++-
.../433-add_pm_mem_standby_modes_support.patch | 115 ++++++++++++++++++++
patches/buildroot/2010.11/040-linux-makefile.patch | 2 +-
...x_in_a_standalone_way_after_configuration.patch | 2 +-
.../buildroot/2010.11/072-xenomai-package.patch | 2 +-
5 files changed, 137 insertions(+), 4 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index 1129a0b..ba137b8 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -49,7 +49,7 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-05-03 16:42:37.000000000 +0200
-@@ -0,0 +1,468 @@
+@@ -0,0 +1,486 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -379,6 +379,22 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c
+ .no_sdio_irq = 1, /* Temporary ! (for Wi2Wi) */
+};
+
++/* board key switchs */
++static struct gpio_keys_button apf51_buttons[] = {
++ {
++ .gpio = IMX_GPIO_NR(1, 3),
++ .code = BTN_0,
++ .desc = "USER",
++ .active_low = 1,
++ .wakeup = 1, /* GPIO1_3 cannot wakeup anyway */
++ },
++};
++
++static const struct gpio_keys_platform_data imx_button_data __initconst = {
++ .buttons = apf51_buttons,
++ .nbuttons = ARRAY_SIZE(apf51_buttons),
++};
++
+static int init_gpio(void)
+{
+#define USER_LED_GPIO (GPIO_PORTA | 2)
@@ -483,6 +499,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c
+
+ init_gpio();
+
++ imx51_add_gpio_keys(&imx_button_data);
++
+ imx51_add_sdhci_esdhc_imx(0, &edshc0_pdata);
+ imx51_add_sdhci_esdhc_imx(1, &edshc1_pdata);
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
new file mode 100644
index 0000000..da45950
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
@@ -0,0 +1,115 @@
+From: Dinh Nguyen <Din...@fr...>
+Adds initial low power suspend functionality to MX51.
+Supports "mem" and "standby" modes.
+Signed-off-by: Dinh Nguyen <Din...@fr...>
+---
+ arch/arm/mach-mx5/Makefile      |   1 +
+ arch/arm/mach-mx5/pm.c        |  75 ++++++++++++++++++++++++++++++++++
+Â arch/arm/plat-mxc/include/mach/mxc.h | Â Â 1 +
+Â 3 files changed, 77 insertions(+), 0 deletions(-)
+Â create mode 100644 arch/arm/mach-mx5/pm.c
+diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
+index 4f63048..7f9435d 100644
+--- a/arch/arm/mach-mx5/Makefile
++++ b/arch/arm/mach-mx5/Makefile
+@@ -6,6 +6,7 @@
+ obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
+ obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
++obj-$(CONFIG_PM) += pm.o
+
+ obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
+ obj-$(CONFIG_MACH_APF51) += board-apf51.o
+ obj-$(CONFIG_MACH_APF51_DEV) += apf51dev-baseboard.o
+diff --git a/arch/arm/mach-mx5/pm.c b/arch/arm/mach-mx5/pm.c
+new file mode 100644
+index 0000000..137d204
+--- /dev/null
++++ b/arch/arm/mach-mx5/pm.c
+@@ -0,0 +1,75 @@
++/*
++ * Â Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++#include <linux/suspend.h>
++#include <asm/mach/map.h>
++#include <mach/system.h>
++#include "crm_regs.h"
++
++static int mx5_suspend_enter(suspend_state_t state)
++{
++ u32 plat_lpc, arm_srpgcr, ccm_clpcr;
++
++ /* always allow platform to issue a deep sleep mode request */
++ plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
++ ~(MXC_CORTEXA8_PLAT_LPC_DSM);
++ ccm_clpcr = __raw_readl(MXC_CCM_CLPCR) & ~(MXC_CCM_CLPCR_LPM_MASK);
++ arm_srpgcr = __raw_readl(MXC_SRPG_ARM_SRPGCR) & ~(MXC_SRPGCR_PCR);
++
++ switch (state) {
++ case PM_SUSPEND_MEM:
++ ccm_clpcr |= (0x2 << MXC_CCM_CLPCR_LPM_OFFSET);
++ ccm_clpcr |= (0x3 << MXC_CCM_CLPCR_STBY_COUNT_OFFSET);
++ ccm_clpcr |= MXC_CCM_CLPCR_VSTBY;
++ ccm_clpcr |= MXC_CCM_CLPCR_SBYOS;
++ break;
++ case PM_SUSPEND_STANDBY:
++ ccm_clpcr |= (0x1 << MXC_CCM_CLPCR_LPM_OFFSET);
++ ccm_clpcr &= ~MXC_CCM_CLPCR_VSTBY;
++ ccm_clpcr &= ~MXC_CCM_CLPCR_SBYOS;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ plat_lpc |= MXC_CORTEXA8_PLAT_LPC_DSM
++ | MXC_CORTEXA8_PLAT_LPC_DBG_DSM;
++ arm_srpgcr |= MXC_SRPGCR_PCR;
++
++ __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
++ __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
++ __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
++ __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
++
++ if (tzic_enable_wake(0) != 0)
++ return -EAGAIN;
++
++ cpu_do_idle();
++ return 0;
++}
++
++static int mx5_pm_valid(suspend_state_t state)
++{
++ return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
++}
++
++static const struct platform_suspend_ops mx5_suspend_ops = {
++ .valid = mx5_pm_valid,
++ .enter = mx5_suspend_enter,
++};
++
++static int __init mx5_pm_init(void)
++{
++ if (cpu_is_mx51())
++ suspend_set_ops(&mx5_suspend_ops);
++
++ return 0;
++}
++device_initcall(mx5_pm_init);
+diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
+index 04c7a26..a72839f 100644
+--- a/arch/arm/plat-mxc/include/mach/mxc.h
++++ b/arch/arm/plat-mxc/include/mach/mxc.h
+@@ -54,6 +54,7 @@
+ #ifndef __ASSEMBLY__
+ extern unsigned int __mxc_cpu_type;
++int tzic_enable_wake(int is_idle);
+ #endif
+
+ #ifdef CONFIG_ARCH_MX1
+
diff --git a/patches/buildroot/2010.11/040-linux-makefile.patch b/patches/buildroot/2010.11/040-linux-makefile.patch
index 7feaa1d..ca29a96 100644
--- a/patches/buildroot/2010.11/040-linux-makefile.patch
+++ b/patches/buildroot/2010.11/040-linux-makefile.patch
@@ -17,7 +17,7 @@ Index: buildroot/linux/linux.mk
$(call KCONFIG_ENABLE_OPT,CONFIG_INITRAMFS_COMPRESSION_GZIP,$(@D)/.config)
endif
+ifeq ($(strip $(BR2_TARGET_ARMADEUS)),y)
-+ (cd $(LINUX26_DIR)/drivers; ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ armadeus)
++ (ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ $(LINUX26_DIR)/drivers/armadeus)
+endif
$(TARGET_MAKE_ENV) $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(@D) oldconfig
$(Q)touch $@
diff --git a/patches/buildroot/2010.11/060-makes_possible_to_compile_linux_in_a_standalone_way_after_configuration.patch b/patches/buildroot/2010.11/060-makes_possible_to_compile_linux_in_a_standalone_way_after_configuration.patch
index 7524141..d8f20b4 100644
--- a/patches/buildroot/2010.11/060-makes_possible_to_compile_linux_in_a_standalone_way_after_configuration.patch
+++ b/patches/buildroot/2010.11/060-makes_possible_to_compile_linux_in_a_standalone_way_after_configuration.patch
@@ -8,6 +8,6 @@ Index: buildroot/linux/linux.mk
ifeq ($(strip $(BR2_TARGET_ARMADEUS)),y)
+ $(SED) "s,^ARCH.*,ARCH=$(KERNEL_ARCH),g;" $(LINUX26_DIR)/Makefile
+ $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX26_DIR)/Makefile
- (cd $(LINUX26_DIR)/drivers; ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ armadeus)
+ (ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ $(LINUX26_DIR)/drivers/armadeus)
endif
$(TARGET_MAKE_ENV) $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(@D) oldconfig
diff --git a/patches/buildroot/2010.11/072-xenomai-package.patch b/patches/buildroot/2010.11/072-xenomai-package.patch
index d39eb4e..f32236c 100644
--- a/patches/buildroot/2010.11/072-xenomai-package.patch
+++ b/patches/buildroot/2010.11/072-xenomai-package.patch
@@ -20,7 +20,7 @@ Index: buildroot/linux/linux.mk
+++ buildroot/linux/linux.mk 2011-01-18 22:37:08.000000000 +0100
@@ -117,6 +117,9 @@
$(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX26_DIR)/Makefile
- (cd $(LINUX26_DIR)/drivers; ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ armadeus)
+ (ln -sf $(ARMADEUS_TOPDIR)/target/linux/modules/ $(LINUX26_DIR)/drivers/armadeus)
endif
+ifeq ($(BR2_PACKAGE_XENOMAI),y)
+ make -C ../buildroot xenomai-patch-kernel
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-27 14:53:02
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 00aa4d97ab660d9b14063aaa8ec0f3d038010ac8 (commit)
from d10a70d0fa5f8ffb5092d8e518c7afca571e5536 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 00aa4d97ab660d9b14063aaa8ec0f3d038010ac8
Author: Julien Boibessot <jul...@ar...>
Date: Fri May 27 16:51:36 2011 +0200
[BUILDROOT] Makes uucp package install fine
-----------------------------------------------------------------------
Summary of changes:
.../buildroot/2010.11/095-uucp-add_packages.patch | 29 ++++++++++++-------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/patches/buildroot/2010.11/095-uucp-add_packages.patch b/patches/buildroot/2010.11/095-uucp-add_packages.patch
index ddeca17..b426ca8 100644
--- a/patches/buildroot/2010.11/095-uucp-add_packages.patch
+++ b/patches/buildroot/2010.11/095-uucp-add_packages.patch
@@ -6,9 +6,9 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: buildroot/package/Config.in
===================================================================
---- buildroot.orig/package/Config.in 2011-01-27 15:24:45.000000000 +0100
-+++ buildroot/package/Config.in 2011-01-27 15:24:47.000000000 +0100
-@@ -449,6 +449,7 @@
+--- buildroot.orig/package/Config.in 2011-05-27 15:32:05.000000000 +0200
++++ buildroot/package/Config.in 2011-05-27 16:47:49.000000000 +0200
+@@ -448,6 +448,7 @@
source "package/tn5250/Config.in"
source "package/ttcp/Config.in"
source "package/udpcast/Config.in"
@@ -19,30 +19,36 @@ Index: buildroot/package/Config.in
Index: buildroot/package/uucp/uucp.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/uucp/uucp.mk 2011-01-27 15:24:47.000000000 +0100
-@@ -0,0 +1,17 @@
++++ buildroot/package/uucp/uucp.mk 2011-05-27 16:47:39.000000000 +0200
+@@ -0,0 +1,23 @@
+#############################################################
+#
-+# uucp (cu, ...??)
++# uucp (uucico, uusched, uuxqt, uux, uucp, uustat, uulog,
++# uuname, uuto, uupick, and cu)
+#
+#############################################################
+
+UUCP_VERSION:=1.07
+UUCP_SOURCE:=uucp_$(UUCP_VERSION).orig.tar.gz
+UUCP_SITE:=http://ftp.debian.org/debian/pool/main/u/uucp/
-+#UUCP_AUTORECONF:=no
-+UUCP_INSTALL_STAGING:=YES
-+UUCP_INSTALL_TARGET:=YES
++# or ftp://ftp.gnu.org/pub/gnu/uucp/uucp-1.07.tar.gz
++
++define UUCP_INSTALL_STRIP_FIXUP
++ $(SED) 's,INSTALL_SCRIPT = $${INSTALL_PROGRAM},INSTALL_SCRIPT = $${INSTALL},g' $(UUCP_DIR)/Makefile
++endef
++
++# Otherwise executables aren't installed stripped
+ifeq ($(BR2_ENABLE_DEBUG),)
+UUCP_INSTALL_TARGET_OPT:=DESTDIR=$(TARGET_DIR) STRIPPROG='$(STRIPCMD)' install-strip
++UUCP_POST_CONFIGURE_HOOKS += UUCP_INSTALL_STRIP_FIXUP
+endif
+
+$(eval $(call AUTOTARGETS,package,uucp))
Index: buildroot/package/uucp/Config.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/uucp/Config.in 2011-01-27 15:24:47.000000000 +0100
-@@ -0,0 +1,11 @@
++++ buildroot/package/uucp/Config.in 2011-05-27 16:25:57.000000000 +0200
+@@ -0,0 +1,12 @@
+config BR2_PACKAGE_UUCP
+ bool "uucp"
+ help
@@ -53,4 +59,5 @@ Index: buildroot/package/uucp/Config.in
+ can be made via modems, direct (hard-wired) serial connections or via an
+ IP connection.
+
++ http://www.airs.com/ian/uucp.html
+ http://packages.debian.org/lenny/uucp
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-27 13:29:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d10a70d0fa5f8ffb5092d8e518c7afca571e5536 (commit)
from 231931d9f012ed086fc20df212e995c1993809c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d10a70d0fa5f8ffb5092d8e518c7afca571e5536
Author: Julien Boibessot <jul...@ar...>
Date: Fri May 27 15:16:10 2011 +0200
[U-BOOT] Add I2C support to the APF51
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf51/apf51-u-boot-2010.03.h | 9 +-
.../target/u-boot/u-boot-2010.03-401-apf51.patch | 54 +++---
...le-mxc_i2c-add_support_for_MX53_processor.patch | 73 +++++++
...c_i2c-add_support_for_the_iMX35_processor.patch | 41 ++++
...3-422-denx-mxc_i2c-get_rid_of__REG_access.patch | 203 ++++++++++++++++++++
...c_i2c-address_failure_with_mx35_processor.patch | 191 ++++++++++++++++++
...c_i2c-add_support_for_the_iMX51_processor.patch | 18 ++
7 files changed, 561 insertions(+), 28 deletions(-)
create mode 100644 buildroot/target/u-boot/u-boot-2010.03-420-freescale-mxc_i2c-add_support_for_MX53_processor.patch
create mode 100644 buildroot/target/u-boot/u-boot-2010.03-421-denx-mxc_i2c-add_support_for_the_iMX35_processor.patch
create mode 100644 buildroot/target/u-boot/u-boot-2010.03-422-denx-mxc_i2c-get_rid_of__REG_access.patch
create mode 100644 buildroot/target/u-boot/u-boot-2010.03-423-denx-mxc_i2c-address_failure_with_mx35_processor.patch
create mode 100644 buildroot/target/u-boot/u-boot-2010.03-424-armadeus-mxc_i2c-add_support_for_the_iMX51_processor.patch
diff --git a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
index 3a4694c..5ff0ecb 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
+++ b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
@@ -92,7 +92,7 @@
#define CONFIG_CMD_FAT /* FAT support */
#define CONFIG_CMD_EXT2 /* EXT2 Support */
#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
-//#define CONFIG_CMD_I2C /* I2C serial bus support */
+#define CONFIG_CMD_I2C /* I2C serial bus support */
#define CONFIG_CMD_IIM /* imx iim fuse */
#undef CONFIG_CMD_IMLS /* List all found images */
#define CONFIG_CMD_IMMAP /* IMMR dump support */
@@ -711,11 +711,12 @@
/**
- * I2C Configs TODO TODO TODO TODO
+ * I2C Configs
*/
-//#define CONFIG_HARD_I2C 1 /* I2C with hardware support */
-//#define CONFIG_I2C_MXC 1
+#define CONFIG_HARD_I2C 1 /* I2C with hardware support */
+#define CONFIG_I2C_MXC 1
#define CONFIG_SYS_I2C_PORT I2C2_BASE_ADDR
+#define CONFIG_SYS_I2C_MX51_PORT2
#define CONFIG_SYS_I2C_SPEED 400000
#define CONFIG_SYS_I2C_SLAVE 0xfe
diff --git a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
index 14172fe..1f31e65 100644
--- a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
+++ b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
@@ -1,8 +1,8 @@
Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/apf51.c 2011-01-05 18:11:15.000000000 +0100
-@@ -0,0 +1,1151 @@
++++ u-boot-2010.03/board/armadeus/apf51/apf51.c 2011-05-27 11:22:10.000000000 +0200
+@@ -0,0 +1,1157 @@
+/*
+ * (C) Copyright 2010 Eric Jarrige, Armadeus Project
+ *
@@ -198,7 +198,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ /*
+ * uart3
+ */
-+#ifdef APF51_RECOVER // temporary
++#ifdef APF51_RECOVER /* temporary */
+ mxc_request_iomux(MX51_PIN_AUD3_BB_RXD, IOMUX_CONFIG_ALT1);
+ mxc_request_iomux(MX51_PIN_AUD3_BB_FS, IOMUX_CONFIG_ALT1);
+ mxc_iomux_set_pad(MX51_PIN_AUD3_BB_RXD, UART_PAD_CFG);
@@ -545,7 +545,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ mxc_iomux_set_pad(MX51_PIN_NANDF_WP_B, NAND_PAD100K_CFG);
+
+ mxc_request_iomux(MX51_PIN_NANDF_RB0 , IOMUX_CONFIG_ALT0);
-+ mxc_iomux_set_pad(MX51_PIN_NANDF_RB0 , PAD_CTL_DRV_VOT_HIGH |
++ mxc_iomux_set_pad(MX51_PIN_NANDF_RB0 , PAD_CTL_DRV_VOT_HIGH |
+ PAD_CTL_HYS_NONE | PAD_CTL_PKE_ENABLE |
+ PAD_CTL_PUE_PULL | PAD_CTL_100K_PU);
+
@@ -594,9 +594,9 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ */
+ mxc_request_iomux(MX51_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT0);
+ mxc_request_iomux(MX51_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT0);
-+ mxc_request_iomux(MX51_PIN_CSPI1_SS0 , IOMUX_CONFIG_ALT0);
-+ mxc_request_iomux(MX51_PIN_CSPI1_SS1 , IOMUX_CONFIG_ALT0);
-+ mxc_request_iomux(MX51_PIN_CSPI1_RDY , IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_CSPI1_SS0, IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_CSPI1_SS1, IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_CSPI1_RDY, IOMUX_CONFIG_ALT0);
+ mxc_request_iomux(MX51_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT0);
+
+ /*
@@ -618,7 +618,8 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ mxc_iomux_set_pad(MX51_PIN_NANDF_D14, CSPI_PAD_CFG);
+ mxc_iomux_set_pad(MX51_PIN_NANDF_D15, CSPI_PAD_CFG);
+
-+ mxc_iomux_set_input(MUX_IN_CSPI_IPP_IND_SS_B_1_SELECT_INPUT,INPUT_CTL_PATH1);
++ mxc_iomux_set_input(MUX_IN_CSPI_IPP_IND_SS_B_1_SELECT_INPUT,
++ INPUT_CTL_PATH1);
+}
+
+#define GPIO_DR 0x00 /* Data Register */
@@ -677,19 +678,24 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ switch (module_base) {
+ case I2C1_BASE_ADDR:
+ /* SCL */
-+ mxc_request_iomux(MX51_PIN_I2C1_CLK, IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_I2C1_CLK,
++ IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
+
+ /* SDA */
-+ mxc_request_iomux(MX51_PIN_I2C1_DAT, IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_I2C1_DAT,
++ IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
+ break;
+
+ case I2C2_BASE_ADDR: /* do not use without disabling UART3 first */
+ /* SCL */
-+ mxc_request_iomux(MX51_PIN_I2C2_CLK, IOMUX_CONFIG_ALT4);
++ mxc_request_iomux(MX51_PIN_EIM_D24,
++ IOMUX_CONFIG_ALT4 | IOMUX_CONFIG_SION);
+
+ /* SDA */
-+ mxc_request_iomux(MX51_PIN_I2C2_DAT, IOMUX_CONFIG_ALT4);
-+ mxc_iomux_set_input(MUX_IN_I2C2_IPP_SDA_IN_SELECT_INPUT,INPUT_CTL_PATH0);
++ mxc_request_iomux(MX51_PIN_EIM_D27,
++ IOMUX_CONFIG_ALT4 | IOMUX_CONFIG_SION);
++ mxc_iomux_set_input(MUX_IN_I2C2_IPP_SDA_IN_SELECT_INPUT,
++ INPUT_CTL_PATH0);
+ break;
+
+ default:
@@ -1157,14 +1163,14 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
Index: u-boot-2010.03/board/armadeus/apf51/config.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/config.mk 2011-01-05 18:11:15.000000000 +0100
++++ u-boot-2010.03/board/armadeus/apf51/config.mk 2011-05-26 17:46:17.000000000 +0200
@@ -0,0 +1,2 @@
+LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
+TEXT_BASE = 0x9FF00000
Index: u-boot-2010.03/board/armadeus/apf51/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/Makefile 2011-01-05 18:11:15.000000000 +0100
++++ u-boot-2010.03/board/armadeus/apf51/Makefile 2011-05-26 17:46:17.000000000 +0200
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2007, Guennadi Liakhovetski <lg...@de...>
@@ -1219,7 +1225,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/Makefile
Index: u-boot-2010.03/board/armadeus/apf51/u-boot.lds
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/u-boot.lds 2011-01-05 18:11:15.000000000 +0100
++++ u-boot-2010.03/board/armadeus/apf51/u-boot.lds 2011-05-26 17:46:17.000000000 +0200
@@ -0,0 +1,64 @@
+/*
+ * January 2004 - Changed to support H4 device
@@ -1287,8 +1293,8 @@ Index: u-boot-2010.03/board/armadeus/apf51/u-boot.lds
+}
Index: u-boot-2010.03/include/asm-arm/mach-types.h
===================================================================
---- u-boot-2010.03.orig/include/asm-arm/mach-types.h 2011-01-05 18:05:11.000000000 +0100
-+++ u-boot-2010.03/include/asm-arm/mach-types.h 2011-01-05 18:11:15.000000000 +0100
+--- u-boot-2010.03.orig/include/asm-arm/mach-types.h 2010-03-31 23:54:39.000000000 +0200
++++ u-boot-2010.03/include/asm-arm/mach-types.h 2011-05-26 17:46:17.000000000 +0200
@@ -2699,6 +2699,7 @@
#define MACH_TYPE_MX53_EVK 2716
#define MACH_TYPE_IGEP0030 2717
@@ -1318,8 +1324,8 @@ Index: u-boot-2010.03/include/asm-arm/mach-types.h
*/
Index: u-boot-2010.03/MAKEALL
===================================================================
---- u-boot-2010.03.orig/MAKEALL 2011-01-05 18:09:44.000000000 +0100
-+++ u-boot-2010.03/MAKEALL 2011-01-05 18:11:15.000000000 +0100
+--- u-boot-2010.03.orig/MAKEALL 2011-05-26 17:46:17.000000000 +0200
++++ u-boot-2010.03/MAKEALL 2011-05-26 17:46:17.000000000 +0200
@@ -549,6 +549,7 @@
ap946es \
ap966 \
@@ -1330,8 +1336,8 @@ Index: u-boot-2010.03/MAKEALL
cp926ejs \
Index: u-boot-2010.03/Makefile
===================================================================
---- u-boot-2010.03.orig/Makefile 2011-01-05 18:09:44.000000000 +0100
-+++ u-boot-2010.03/Makefile 2011-01-05 18:11:15.000000000 +0100
+--- u-boot-2010.03.orig/Makefile 2011-05-26 17:46:17.000000000 +0200
++++ u-boot-2010.03/Makefile 2011-05-26 17:46:17.000000000 +0200
@@ -2735,6 +2735,9 @@
apf27_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs apf27 armadeus mx27
@@ -1345,7 +1351,7 @@ Index: u-boot-2010.03/Makefile
Index: u-boot-2010.03/board/armadeus/apf51/fpga.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/fpga.h 2011-01-05 18:11:15.000000000 +0100
++++ u-boot-2010.03/board/armadeus/apf51/fpga.h 2011-05-26 17:46:17.000000000 +0200
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2002-2010
@@ -1389,7 +1395,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/fpga.h
Index: u-boot-2010.03/board/armadeus/apf51/fpga.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot-2010.03/board/armadeus/apf51/fpga.c 2011-01-05 18:11:15.000000000 +0100
++++ u-boot-2010.03/board/armadeus/apf51/fpga.c 2011-05-26 17:46:17.000000000 +0200
@@ -0,0 +1,271 @@
+/*
+ * (C) Copyright 2002-2010
diff --git a/buildroot/target/u-boot/u-boot-2010.03-420-freescale-mxc_i2c-add_support_for_MX53_processor.patch b/buildroot/target/u-boot/u-boot-2010.03-420-freescale-mxc_i2c-add_support_for_MX53_processor.patch
new file mode 100644
index 0000000..58a8331
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-2010.03-420-freescale-mxc_i2c-add_support_for_MX53_processor.patch
@@ -0,0 +1,73 @@
+From: Liu Hui-R64343 <r6...@fr...>
+Date: Mon, 3 Jan 2011 22:27:39 +0000 (+0000)
+Subject: mxc_i2c: add support for MX53 processor
+X-Git-Tag: v2011.03-rc1~2^2~45
+X-Git-Url: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commitdiff_plain;h=127cec1889c7a9bb3c3eab521779b08657043a9a
+
+mxc_i2c: add support for MX53 processor
+
+This patch add I2C support for Freescale MX53 processor
+
+Signed-off-by: Jason Liu <r6...@fr...>
+---
+
+diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
+index 8e10fbb..1ebec14 100644
+--- a/drivers/i2c/mxc_i2c.c
++++ b/drivers/i2c/mxc_i2c.c
+@@ -26,8 +26,14 @@
+
+ #if defined(CONFIG_HARD_I2C)
+
++#if defined(CONFIG_MX31)
+ #include <asm/arch/mx31.h>
+ #include <asm/arch/mx31-regs.h>
++#endif
++
++#if defined(CONFIG_MX53)
++#include <asm/arch/clock.h>
++#endif
+
+ #define IADR 0x00
+ #define IFDR 0x04
+@@ -47,7 +53,7 @@
+ #define I2SR_IIF (1 << 1)
+ #define I2SR_RX_NO_AK (1 << 0)
+
+-#ifdef CONFIG_SYS_I2C_MX31_PORT1
++#if defined(CONFIG_SYS_I2C_MX31_PORT1)
+ #define I2C_BASE 0x43f80000
+ #define I2C_CLK_OFFSET 26
+ #elif defined (CONFIG_SYS_I2C_MX31_PORT2)
+@@ -56,8 +62,12 @@
+ #elif defined (CONFIG_SYS_I2C_MX31_PORT3)
+ #define I2C_BASE 0x43f84000
+ #define I2C_CLK_OFFSET 30
++#elif defined(CONFIG_SYS_I2C_MX53_PORT1)
++#define I2C_BASE I2C1_BASE_ADDR
++#elif defined(CONFIG_SYS_I2C_MX53_PORT2)
++#define I2C_BASE I2C2_BASE_ADDR
+ #else
+-#error "define CONFIG_SYS_I2C_MX31_PORTx to use the mx31 I2C driver"
++#error "define CONFIG_SYS_I2C_MXxx_PORTx to use the I2C driver"
+ #endif
+
+ #ifdef DEBUG
+@@ -72,11 +82,16 @@ static u16 div[] = { 30, 32, 36, 42, 48, 52, 60, 72, 80, 88, 104, 128, 144,
+
+ void i2c_init(int speed, int unused)
+ {
+- int freq = mx31_get_ipg_clk();
++ int freq;
+ int i;
+
++#if defined(CONFIG_MX31)
++ freq = mx31_get_ipg_clk();
+ /* start the required I2C clock */
+ __REG(CCM_CGR0) = __REG(CCM_CGR0) | (3 << I2C_CLK_OFFSET);
++#else
++ freq = mxc_get_clock(MXC_IPG_PERCLK);
++#endif
+
+ for (i = 0; i < 0x1f; i++)
+ if (freq / div[i] <= speed)
diff --git a/buildroot/target/u-boot/u-boot-2010.03-421-denx-mxc_i2c-add_support_for_the_iMX35_processor.patch b/buildroot/target/u-boot/u-boot-2010.03-421-denx-mxc_i2c-add_support_for_the_iMX35_processor.patch
new file mode 100644
index 0000000..5c16cb5
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-2010.03-421-denx-mxc_i2c-add_support_for_the_iMX35_processor.patch
@@ -0,0 +1,41 @@
+From: Stefano Babic <sb...@de...>
+Date: Wed, 19 Jan 2011 22:46:26 +0000 (+0000)
+Subject: mxc_i2c: Add support for the i.MX35 processor
+X-Git-Tag: v2011.03-rc1~2^2~34
+X-Git-Url: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commitdiff_plain;h=04220612f69a7148f7f6d045638c8046bd265b29
+
+mxc_i2c: Add support for the i.MX35 processor
+
+Signed-off-by: Stefano Babic <sb...@de...>
+CC: Heiko Schocher <hs...@de...>
+Acked-by: Heiko Schocher <hs...@de...>
+---
+
+diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
+index 1ebec14..7f669ff 100644
+--- a/drivers/i2c/mxc_i2c.c
++++ b/drivers/i2c/mxc_i2c.c
+@@ -29,9 +29,8 @@
+ #if defined(CONFIG_MX31)
+ #include <asm/arch/mx31.h>
+ #include <asm/arch/mx31-regs.h>
+-#endif
+-
+-#if defined(CONFIG_MX53)
++#else
++#include <asm/arch/imx-regs.h>
+ #include <asm/arch/clock.h>
+ #endif
+
+@@ -66,8 +65,10 @@
+ #define I2C_BASE I2C1_BASE_ADDR
+ #elif defined(CONFIG_SYS_I2C_MX53_PORT2)
+ #define I2C_BASE I2C2_BASE_ADDR
++#elif defined(CONFIG_SYS_I2C_MX35_PORT1)
++#define I2C_BASE I2C_BASE_ADDR
+ #else
+-#error "define CONFIG_SYS_I2C_MXxx_PORTx to use the I2C driver"
++#error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver"
+ #endif
+
+ #ifdef DEBUG
diff --git a/buildroot/target/u-boot/u-boot-2010.03-422-denx-mxc_i2c-get_rid_of__REG_access.patch b/buildroot/target/u-boot/u-boot-2010.03-422-denx-mxc_i2c-get_rid_of__REG_access.patch
new file mode 100644
index 0000000..f2968dc
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-2010.03-422-denx-mxc_i2c-get_rid_of__REG_access.patch
@@ -0,0 +1,203 @@
+From: Stefano Babic <sb...@de...>
+Date: Thu, 20 Jan 2011 07:50:44 +0000 (+0000)
+Subject: I2C: mxc_i2c: get rid of __REG access
+X-Git-Tag: v2011.03-rc1~2^2~33
+X-Git-Url: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commitdiff_plain;h=1d549ade61078b50e68ff867fe59401bb5c2db9b
+
+I2C: mxc_i2c: get rid of __REG access
+
+This driver accesses to processor's register
+via __REG macros, that are removed (or are planned
+to be removed) and replaced by C structures.
+This patches replaces all occurrencies of __REG macros.
+
+Signed-off-by: Stefano Babic <sb...@de...>
+CC: Heiko Schocher <hs...@de...>
+Acked-by: Heiko Schocher <hs...@de...>
+---
+
+diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
+index 7f669ff..fd6db18 100644
+--- a/drivers/i2c/mxc_i2c.c
++++ b/drivers/i2c/mxc_i2c.c
+@@ -23,6 +23,7 @@
+ */
+
+ #include <common.h>
++#include <asm/io.h>
+
+ #if defined(CONFIG_HARD_I2C)
+
+@@ -81,15 +82,26 @@ static u16 div[] = { 30, 32, 36, 42, 48, 52, 60, 72, 80, 88, 104, 128, 144,
+ 160, 192, 240, 288, 320, 384, 480, 576, 640, 768, 960,
+ 1152, 1280, 1536, 1920, 2304, 2560, 3072, 3840};
+
++static inline void i2c_reset(void)
++{
++ writew(0, I2C_BASE + I2CR); /* Reset module */
++ writew(0, I2C_BASE + I2SR);
++ writew(I2CR_IEN, I2C_BASE + I2CR);
++}
++
+ void i2c_init(int speed, int unused)
+ {
+ int freq;
+ int i;
+
+ #if defined(CONFIG_MX31)
++ struct clock_control_regs *sc_regs =
++ (struct clock_control_regs *)CCM_BASE;
++
+ freq = mx31_get_ipg_clk();
+ /* start the required I2C clock */
+- __REG(CCM_CGR0) = __REG(CCM_CGR0) | (3 << I2C_CLK_OFFSET);
++ writel(readl(&sc_regs->cgr0) | (3 << I2C_CLK_OFFSET),
++ &sc_regs->cgr0);
+ #else
+ freq = mxc_get_clock(MXC_IPG_PERCLK);
+ #endif
+@@ -98,30 +110,28 @@ void i2c_init(int speed, int unused)
+ if (freq / div[i] <= speed)
+ break;
+
+- DPRINTF("%s: speed: %d\n",__FUNCTION__, speed);
++ debug("%s: speed: %d\n", __func__, speed);
+
+- __REG16(I2C_BASE + I2CR) = 0; /* Reset module */
+- __REG16(I2C_BASE + IFDR) = i;
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN;
+- __REG16(I2C_BASE + I2SR) = 0;
++ writew(i, I2C_BASE + IFDR);
++ i2c_reset();
+ }
+
+ static int wait_busy(void)
+ {
+ int timeout = 10000;
+
+- while (!(__REG16(I2C_BASE + I2SR) & I2SR_IIF) && --timeout)
++ while (!(readw(I2C_BASE + I2SR) & I2SR_IIF) && --timeout)
+ udelay(1);
+- __REG16(I2C_BASE + I2SR) = 0; /* clear interrupt */
++ writew(0, I2C_BASE + I2SR); /* clear interrupt */
+
+ return timeout;
+ }
+
+ static int tx_byte(u8 byte)
+ {
+- __REG16(I2C_BASE + I2DR) = byte;
++ writew(byte, I2C_BASE + I2DR);
+
+- if (!wait_busy() || __REG16(I2C_BASE + I2SR) & I2SR_RX_NO_AK)
++ if (!wait_busy() || readw(I2C_BASE + I2SR) & I2SR_RX_NO_AK)
+ return -1;
+ return 0;
+ }
+@@ -131,27 +141,27 @@ static int rx_byte(void)
+ if (!wait_busy())
+ return -1;
+
+- return __REG16(I2C_BASE + I2DR);
++ return readw(I2C_BASE + I2DR);
+ }
+
+ int i2c_probe(uchar chip)
+ {
+ int ret;
+
+- __REG16(I2C_BASE + I2CR) = 0; /* Reset module */
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN;
++ writew(0, I2C_BASE + I2CR); /* Reset module */
++ writew(I2CR_IEN, I2C_BASE + I2CR);
+
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA | I2CR_MTX;
++ writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR);
+ ret = tx_byte(chip << 1);
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MTX;
++ writew(I2CR_IEN | I2CR_MTX, I2C_BASE + I2CR);
+
+ return ret;
+ }
+
+ static int i2c_addr(uchar chip, uint addr, int alen)
+ {
+- __REG16(I2C_BASE + I2SR) = 0; /* clear interrupt */
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA | I2CR_MTX;
++ writew(0, I2C_BASE + I2SR);
++ writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR);
+
+ if (tx_byte(chip << 1))
+ return -1;
+@@ -167,35 +177,40 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+ int timeout = 10000;
+ int ret;
+
+- DPRINTF("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",__FUNCTION__, chip, addr, alen, len);
++ debug("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",
++ __func__, chip, addr, alen, len);
+
+ if (i2c_addr(chip, addr, alen)) {
+ printf("i2c_addr failed\n");
+ return -1;
+ }
+
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA | I2CR_MTX | I2CR_RSTA;
++ writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX | I2CR_RSTA, I2C_BASE + I2CR);
+
+ if (tx_byte(chip << 1 | 1))
+ return -1;
+
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA | ((len == 1) ? I2CR_TX_NO_AK : 0);
++ writew(I2CR_IEN | I2CR_MSTA |
++ ((len == 1) ? I2CR_TX_NO_AK : 0),
++ I2C_BASE + I2CR);
+
+- ret = __REG16(I2C_BASE + I2DR);
++ ret = readw(I2C_BASE + I2DR);
+
+ while (len--) {
+ if ((ret = rx_byte()) < 0)
+ return -1;
+ *buf++ = ret;
+ if (len <= 1)
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MSTA | I2CR_TX_NO_AK;
++ writew(I2CR_IEN | I2CR_MSTA |
++ I2CR_TX_NO_AK,
++ I2C_BASE + I2CR);
+ }
+
+ wait_busy();
+
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN;
++ writew(I2CR_IEN, I2C_BASE + I2CR);
+
+- while (__REG16(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
++ while (readw(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
+ udelay(1);
+
+ return 0;
+@@ -203,8 +218,9 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+
+ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
+ {
+- int timeout = 10000;
+- DPRINTF("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",__FUNCTION__, chip, addr, alen, len);
++ int timeout = I2C_MAX_TIMEOUT;
++ debug("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",
++ __func__, chip, addr, alen, len);
+
+ if (i2c_addr(chip, addr, alen))
+ return -1;
+@@ -213,9 +229,9 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
+ if (tx_byte(*buf++))
+ return -1;
+
+- __REG16(I2C_BASE + I2CR) = I2CR_IEN;
++ writew(I2CR_IEN, I2C_BASE + I2CR);
+
+- while (__REG16(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
++ while (readw(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
+ udelay(1);
+
+ return 0;
diff --git a/buildroot/target/u-boot/u-boot-2010.03-423-denx-mxc_i2c-address_failure_with_mx35_processor.patch b/buildroot/target/u-boot/u-boot-2010.03-423-denx-mxc_i2c-address_failure_with_mx35_processor.patch
new file mode 100644
index 0000000..4a98776
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-2010.03-423-denx-mxc_i2c-address_failure_with_mx35_processor.patch
@@ -0,0 +1,191 @@
+From: Stefano Babic <sb...@de...>
+Date: Thu, 20 Jan 2011 07:51:31 +0000 (+0000)
+Subject: I2C: mxc_i2c: address failure with mx35 processor
+X-Git-Tag: v2011.03-rc1~2^2~32
+X-Git-Url: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commitdiff_plain;h=81687212ee0b4fcb11f7d6700275b062c8f8d2b4
+
+I2C: mxc_i2c: address failure with mx35 processor
+
+There is sporadic failures when more as one I2C slave
+is on the bus and the processor tries to communicate
+with more as one slave.
+The problem was seen on a mx35pdk (two I2C slaves,
+PMIC controller and CAN/RTC chip).
+
+The current driver uses the IIF bit in the status register
+to check if the bus is busy or not. According to the manual,
+this is not correct, because the IIB bit should be checked.
+Not only, to check if a transfer is finished must be checked
+the ICF bit, and this is not tested at all.
+
+This patch comes from analyse with a corresponding driver
+provided by Freescale as part of the LTIB tool. Comparing
+the two drivers, it appears that the current u-boot driver checks
+the wrong bits, and depending on race condition, the transfer
+can be successful or not.
+
+The patch gets rid also of own debug function (DPRINTF),
+replaced with the general debug().
+
+Tested on Freescale mx35pdk.
+
+Signed-off-by: Stefano Babic <sb...@de...>
+CC: Heiko Schocher <hs...@de...>
+Acked-by: Heiko Schocher <hs...@de...>
+---
+
+diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
+index fd6db18..c5ec486 100644
+--- a/drivers/i2c/mxc_i2c.c
++++ b/drivers/i2c/mxc_i2c.c
+@@ -72,11 +72,8 @@
+ #error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver"
+ #endif
+
+-#ifdef DEBUG
+-#define DPRINTF(args...) printf(args)
+-#else
+-#define DPRINTF(args...)
+-#endif
++#define I2C_MAX_TIMEOUT 10000
++#define I2C_MAX_RETRIES 3
+
+ static u16 div[] = { 30, 32, 36, 42, 48, 52, 60, 72, 80, 88, 104, 128, 144,
+ 160, 192, 240, 288, 320, 384, 480, 576, 640, 768, 960,
+@@ -116,31 +113,61 @@ void i2c_init(int speed, int unused)
+ i2c_reset();
+ }
+
++static int wait_idle(void)
++{
++ int timeout = I2C_MAX_TIMEOUT;
++
++ while ((readw(I2C_BASE + I2SR) & I2SR_IBB) && --timeout) {
++ writew(0, I2C_BASE + I2SR);
++ udelay(1);
++ }
++ return timeout ? timeout : (!(readw(I2C_BASE + I2SR) & I2SR_IBB));
++}
++
+ static int wait_busy(void)
+ {
+- int timeout = 10000;
++ int timeout = I2C_MAX_TIMEOUT;
+
+- while (!(readw(I2C_BASE + I2SR) & I2SR_IIF) && --timeout)
++ while (!(readw(I2C_BASE + I2SR) & I2SR_IBB) && --timeout)
+ udelay(1);
+ writew(0, I2C_BASE + I2SR); /* clear interrupt */
+
+ return timeout;
+ }
+
++static int wait_complete(void)
++{
++ int timeout = I2C_MAX_TIMEOUT;
++
++ while ((!(readw(I2C_BASE + I2SR) & I2SR_ICF)) && (--timeout)) {
++ writew(0, I2C_BASE + I2SR);
++ udelay(1);
++ }
++ udelay(200);
++
++ writew(0, I2C_BASE + I2SR); /* clear interrupt */
++
++ return timeout;
++}
++
++
+ static int tx_byte(u8 byte)
+ {
+ writew(byte, I2C_BASE + I2DR);
+
+- if (!wait_busy() || readw(I2C_BASE + I2SR) & I2SR_RX_NO_AK)
++ if (!wait_complete() || readw(I2C_BASE + I2SR) & I2SR_RX_NO_AK)
+ return -1;
+ return 0;
+ }
+
+-static int rx_byte(void)
++static int rx_byte(int last)
+ {
+- if (!wait_busy())
++ if (!wait_complete())
+ return -1;
+
++ if (last)
++ writew(I2CR_IEN, I2C_BASE + I2CR);
++
+ return readw(I2C_BASE + I2DR);
+ }
+
+@@ -160,21 +187,45 @@ int i2c_probe(uchar chip)
+
+ static int i2c_addr(uchar chip, uint addr, int alen)
+ {
+- writew(0, I2C_BASE + I2SR);
+- writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR);
++ int i, retry = 0;
++ for (retry = 0; retry < 3; retry++) {
++ if (wait_idle())
++ break;
++ i2c_reset();
++ for (i = 0; i < I2C_MAX_TIMEOUT; i++)
++ udelay(1);
++ }
++ if (retry >= I2C_MAX_RETRIES) {
++ debug("%s:bus is busy(%x)\n",
++ __func__, readw(I2C_BASE + I2SR));
++ return -1;
++ }
++ writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR);
+
+- if (tx_byte(chip << 1))
++ if (!wait_busy()) {
++ debug("%s:trigger start fail(%x)\n",
++ __func__, readw(I2C_BASE + I2SR));
+ return -1;
++ }
+
++ if (tx_byte(chip << 1) || (readw(I2C_BASE + I2SR) & I2SR_RX_NO_AK)) {
++ debug("%s:chip address cycle fail(%x)\n",
++ __func__, readw(I2C_BASE + I2SR));
++ return -1;
++ }
+ while (alen--)
+- if (tx_byte((addr >> (alen * 8)) & 0xff))
++ if (tx_byte((addr >> (alen * 8)) & 0xff) ||
++ (readw(I2C_BASE + I2SR) & I2SR_RX_NO_AK)) {
++ debug("%s:device address cycle fail(%x)\n",
++ __func__, readw(I2C_BASE + I2SR));
+ return -1;
++ }
+ return 0;
+ }
+
+ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+ {
+- int timeout = 10000;
++ int timeout = I2C_MAX_TIMEOUT;
+ int ret;
+
+ debug("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",
+@@ -197,7 +248,8 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+ ret = readw(I2C_BASE + I2DR);
+
+ while (len--) {
+- if ((ret = rx_byte()) < 0)
++ ret = rx_byte(len == 0);
++ if (ret < 0)
+ return -1;
+ *buf++ = ret;
+ if (len <= 1)
+@@ -206,8 +258,6 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+ I2C_BASE + I2CR);
+ }
+
+- wait_busy();
+-
+ writew(I2CR_IEN, I2C_BASE + I2CR);
+
+ while (readw(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
diff --git a/buildroot/target/u-boot/u-boot-2010.03-424-armadeus-mxc_i2c-add_support_for_the_iMX51_processor.patch b/buildroot/target/u-boot/u-boot-2010.03-424-armadeus-mxc_i2c-add_support_for_the_iMX51_processor.patch
new file mode 100644
index 0000000..3ee8b84
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-2010.03-424-armadeus-mxc_i2c-add_support_for_the_iMX51_processor.patch
@@ -0,0 +1,18 @@
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: u-boot-2010.03/drivers/i2c/mxc_i2c.c
+===================================================================
+--- u-boot-2010.03.orig/drivers/i2c/mxc_i2c.c 2011-05-26 21:57:56.000000000 +0200
++++ u-boot-2010.03/drivers/i2c/mxc_i2c.c 2011-05-27 10:51:46.000000000 +0200
+@@ -62,9 +62,9 @@
+ #elif defined (CONFIG_SYS_I2C_MX31_PORT3)
+ #define I2C_BASE 0x43f84000
+ #define I2C_CLK_OFFSET 30
+-#elif defined(CONFIG_SYS_I2C_MX53_PORT1)
++#elif defined(CONFIG_SYS_I2C_MX53_PORT1) || defined(CONFIG_SYS_I2C_MX51_PORT1)
+ #define I2C_BASE I2C1_BASE_ADDR
+-#elif defined(CONFIG_SYS_I2C_MX53_PORT2)
++#elif defined(CONFIG_SYS_I2C_MX53_PORT2) || defined(CONFIG_SYS_I2C_MX51_PORT2)
+ #define I2C_BASE I2C2_BASE_ADDR
+ #elif defined(CONFIG_SYS_I2C_MX35_PORT1)
+ #define I2C_BASE I2C_BASE_ADDR
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-25 10:11:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 231931d9f012ed086fc20df212e995c1993809c1 (commit)
via 5db82673a4a2113655d1477b330398dc0ea3543b (commit)
via ee426f2e6e843c052bf748d7f92c6782a7ac6e4e (commit)
via 70b6cfb8557236fa0b3c6aab83aa87d5267a8da2 (commit)
from 7cb4f61d238e7614b990f1a24c434b50b46201e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 231931d9f012ed086fc20df212e995c1993809c1
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 25 12:08:25 2011 +0200
[AS_DEVICES] Cleanup as_gpio and add possibility to wait for events/irq on GPIO (edge configurable)
commit 5db82673a4a2113655d1477b330398dc0ea3543b
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 25 12:06:53 2011 +0200
[AS_DEVICES] Makes Python wrapper compiles standalone
commit ee426f2e6e843c052bf748d7f92c6782a7ac6e4e
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 25 12:03:20 2011 +0200
[AS_DEVICES] Cleanup
commit 70b6cfb8557236fa0b3c6aab83aa87d5267a8da2
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 25 11:54:03 2011 +0200
[AS_DEVICES] Add possibility to get APF model (in C)
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_gpio.c | 185 ++++++++++++--------
target/packages/as_devices/c/as_gpio.h | 36 ++--
target/packages/as_devices/c/as_helpers.c | 22 +++
target/packages/as_devices/c/as_helpers.h | 13 ++
target/packages/as_devices/c/as_i2c.c | 1 -
target/packages/as_devices/cpp/as_gpio.cpp | 30 ++--
target/packages/as_devices/cpp/as_gpio.hpp | 12 +-
target/packages/as_devices/main.c | 16 +-
target/packages/as_devices/python/Makefile | 3 +-
.../packages/as_devices/python/src/AsGpio_wrap.c | 38 ++--
target/packages/as_devices/test_c.h | 76 +++++----
target/packages/as_devices/test_cpp.h | 36 ++---
12 files changed, 271 insertions(+), 197 deletions(-)
diff --git a/target/packages/as_devices/c/as_gpio.c b/target/packages/as_devices/c/as_gpio.c
index 24e161d..eb3333b 100644
--- a/target/packages/as_devices/c/as_gpio.c
+++ b/target/packages/as_devices/c/as_gpio.c
@@ -1,7 +1,7 @@
/*
- ** The ARMadeus Project
+ ** C wrapper for GPIOs usage.
**
- ** Copyright (C) 2009, 2010, 2011 The armadeus systems team
+ ** Copyright (C) 2009, 2010, 2011 The Armadeus Project - ARMadeus Systems
** Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
@@ -24,14 +24,15 @@
#include <fcntl.h>
#include <unistd.h> /* for close() */
#include <sys/select.h>
+#include <poll.h>
+#include <errno.h>
#include <sys/ioctl.h>
-#include <linux/ppdev.h>
#include "as_helpers.h"
#include "as_gpio.h"
-#define BUFF_SIZE (300)
+#define BUFF_SIZE 300
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
@@ -96,69 +97,53 @@ struct as_gpio_device *as_gpio_open(char aPortChar, int aPinNum)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_direction(struct as_gpio_device *aDev, int aDirection)
+int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev, char *direction)
{
- char buf[BUFF_SIZE];
- int pin_file;
- int retval;
+ char buf[BUFF_SIZE];
+ int gpio_fd;
+ int ret = 0;
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", aDev->port_num);
- pin_file = open(buf, O_WRONLY);
- if (pin_file < 0) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
- return -1;
- }
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", gpio_dev->port_num);
+ gpio_fd = open(buf, O_WRONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d direction\n", gpio_dev->port_num);
+ return -EINVAL;
+ }
- if (aDirection == 0) {
- retval = as_write_buffer_string(pin_file, "in");
- if (retval < 0) {
- ERROR("Error writting direction\n");
- close(pin_file);
- return -1;
- }
- } else {
- retval = as_write_buffer_string(pin_file, "out");
- if (retval < 0) {
- ERROR("Error writting direction\n");
- close(pin_file);
- return -1;
- }
- }
- close(pin_file);
+ ret = as_write_buffer_string(gpio_fd, direction);
+ if (ret < 0)
+ ERROR("Error writing direction\n");
+
+ close(gpio_fd);
- return aDirection;
+ return ret;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_pin_direction(struct as_gpio_device *aDev)
+const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev)
{
- char buf[BUFF_SIZE];
- int pin_file;
- int retval;
-
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", aDev->port_num);
- pin_file = open(buf, O_RDONLY);
- if (pin_file < 0) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
- return -1;
- }
- retval = as_read_buffer(pin_file, buf, 4);
- if (retval < 0) {
- ERROR("Can't read gpio%d direction file\n", aDev->port_num);
- close(pin_file);
- return -1;
- }
- close(pin_file);
-
- if ((buf[0] == 'i') && (buf[1] == 'n'))
- return 0;
- else if ((buf[0] == 'o') && (buf[1] == 'u') && (buf[2] == 't'))
- return 1;
- else {
- ERROR("Wrong value >%s< read in direction file\n", buf);
- return -1;
- }
+ char buf[BUFF_SIZE];
+ static char direction[4];
+ FILE *gpio_file;
+ int ret = 0;
+ static const char none[] = "??";
+
+ snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/direction",
+ gpio_dev->port_num);
+ gpio_file = fopen(buf, "r");
+ if (!gpio_file) {
+ ERROR("Can't open gpio%d direction\n", gpio_dev->port_num);
+ return none;
+ }
+ ret = fscanf(gpio_file, "%s", direction);
+ fclose(gpio_file);
+ if (ret < 0) {
+ ERROR("Can't get gpio%d direction\n", gpio_dev->port_num);
+ return none;
+ }
+
+ return direction;
}
/*------------------------------------------------------------------------------*/
@@ -199,7 +184,7 @@ int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev)
snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aDev->port_num);
pin_file = open(buf, O_RDONLY);
if (pin_file < 0) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
+ ERROR("Can't open gpio%d value\n", aDev->port_num);
return -1;
}
@@ -216,28 +201,85 @@ int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_blocking_get_pin_value(struct as_gpio_device *aDev,
- int aDelay_s,
- int aDelay_us)
+int32_t as_gpio_wait_event(struct as_gpio_device *gpio_dev, int delay_ms)
{
- printf("as_gpio_blocking_get_pin_value:TODO\n");
- return -1;
+ char gpio_sys_name[BUFF_SIZE];
+ int gpio_fd;
+ struct pollfd poll_set[1];
+ int ret;
+ char tmp[16];
+
+ snprintf(gpio_sys_name, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
+ gpio_dev->port_num);
+ gpio_fd = open(gpio_sys_name, O_RDONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d value\n", gpio_dev->port_num);
+ return -EINVAL;
+ }
+
+ /* flush pending event */
+ read(gpio_fd, tmp, sizeof(tmp));
+
+ poll_set[0].fd = gpio_fd;
+ poll_set[0].events = POLLPRI;
+ poll_set[0].revents = 0;
+ ret = poll(poll_set, 1, delay_ms);
+ if (ret > 0) {
+ printf("event received\n");
+ read(gpio_fd, tmp, sizeof(tmp));
+ }
+
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_irq_mode(struct as_gpio_device *aDev)
+const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev)
{
- printf("as_gpio_get_irq_mode:TODO\n");
- return -1;
+ char buf[BUFF_SIZE];
+ static char mode[8];
+ FILE *gpio_file;
+ int ret = 0;
+ static const char unknown[] = "??";
+
+ snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/edge", gpio_dev->port_num);
+ gpio_file = fopen(buf, "r");
+ if (!gpio_file) {
+ ERROR("Can't open gpio%d edge\n", gpio_dev->port_num);
+ return unknown;
+ }
+ ret = fscanf(gpio_file, "%s", mode);
+ fclose(gpio_file);
+ if (ret < 0) {
+ ERROR("Can't get gpio%d edge\n", gpio_dev->port_num);
+ return unknown;
+ }
+
+ return mode;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_irq_mode(struct as_gpio_device *aDev, int aMode)
+int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode)
{
- printf("as_gpio_set_irq_mode:TODO\n");
- return -1;
+ char buf[BUFF_SIZE];
+ int gpio_fd;
+ int ret = 0;
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/edge", gpio_dev->port_num);
+ gpio_fd = open(buf, O_WRONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d edge\n", gpio_dev->port_num);
+ return -EINVAL;
+ }
+
+ ret = as_write_buffer_string(gpio_fd, mode);
+ if (ret < 0)
+ ERROR("Error writing mode\n");
+
+ close(gpio_fd);
+
+ return ret;
}
/*------------------------------------------------------------------------------*/
@@ -249,7 +291,7 @@ int32_t as_gpio_get_pin_num(struct as_gpio_device *aDev)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_port_letter(struct as_gpio_device *aDev)
+char as_gpio_get_port_letter(struct as_gpio_device *aDev)
{
return aDev->port_letter;
}
@@ -261,4 +303,3 @@ int32_t as_gpio_close(struct as_gpio_device *aDev)
return 0;
}
-
diff --git a/target/packages/as_devices/c/as_gpio.h b/target/packages/as_devices/c/as_gpio.h
index 8ba1246..b2b241f 100644
--- a/target/packages/as_devices/c/as_gpio.h
+++ b/target/packages/as_devices/c/as_gpio.h
@@ -57,21 +57,21 @@ struct as_gpio_device *as_gpio_open(char aPortChar, int aPinNum);
/** @brief Set pin direction
*
- * @param aDev as_gpio_device pointer structure
- * @param aDirection direction 0:input 1:output
+ * @param gpio_dev as_gpio_device pointer structure
+ * @param direction "in"/"out"
*
* @return error if negative value
*/
-int32_t as_gpio_set_pin_direction(struct as_gpio_device *aDev,
- int aDirection);
+int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev,
+ char *direction);
/** @brief Get pin direction
*
- * @param aDev as_gpio_device pointer structure
+ * @param gpio_dev as_gpio_device pointer structure
*
* @return error if negative value
*/
-int32_t as_gpio_get_pin_direction(struct as_gpio_device *aDev);
+const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev);
/** @brief Set pin value
*
@@ -91,35 +91,31 @@ int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev,
*/
int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev);
-/** @brief Get pin value, blocking until interrupt occur
+/** @brief Block until an event occur on that pin and return value
*
* @param aDev as_gpio_device pointer structure
- * @param aDelay_s waiting delay in seconds
- * @param aDelay_us waiting delay in useconds (plus delay in seconds)
+ * @param aDelay_ms timeout in milliseconds
*
* @return pin value if positive or null, read error if -1, timeout if -10
*/
-int32_t as_gpio_blocking_get_pin_value(struct as_gpio_device *aDev,
- int aDelay_s,
- int aDelay_us);
+int32_t as_gpio_wait_event(struct as_gpio_device *aDev, int aDelay_ms);
/** @brief Set pin irq mode
*
- * @param aDev as_gpio_device pointer structure
- * @param aMode irq mode
+ * @param gpio_dev as_gpio_device pointer structure
+ * @param mode irq mode (rising/falling/both/none)
*
* @return error if negative
*/
-int32_t as_gpio_set_irq_mode(struct as_gpio_device *aDev,
- int aMode);
+int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode);
/** @brief Get pin irq mode value
*
- * @param aDev as_gpio_device pointer structure
+ * @param gpio_dev as_gpio_device pointer structure
*
- * @return pin mode value if positive or null, error if negative
+ * @return pin triggering mode: (rising/falling/both/none)
*/
-int32_t as_gpio_get_irq_mode(struct as_gpio_device *aDev);
+const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev);
/** @brief Get pin number value
*
@@ -135,7 +131,7 @@ int32_t as_gpio_get_pin_num(struct as_gpio_device *aDev);
*
* @return port letter, error if negative
*/
-int32_t as_gpio_get_port_letter(struct as_gpio_device *aDev);
+char as_gpio_get_port_letter(struct as_gpio_device *aDev);
/** @brief Close port access
*
diff --git a/target/packages/as_devices/c/as_helpers.c b/target/packages/as_devices/c/as_helpers.c
index e2fa27c..7fe7d6d 100644
--- a/target/packages/as_devices/c/as_helpers.c
+++ b/target/packages/as_devices/c/as_helpers.c
@@ -113,3 +113,25 @@ int as_read_int(int fd, int *value_res)
return 0;
}
+int as_helpers_get_platform(void)
+{
+ FILE *plat_file;
+ char name[8];
+ int ret;
+
+ plat_file = fopen("/etc/machine", "r");
+ if (!plat_file)
+ return APF_UNKNOWN;
+
+ ret = fscanf(plat_file, "%s", name);
+ fclose(plat_file);
+
+ if (!strcmp(name, "APF9328"))
+ return APF9328;
+ if (!strcmp(name, "APF27"))
+ return APF27;
+ if (!strcmp(name, "APF51"))
+ return APF51;
+
+ return APF_UNKNOWN;
+}
diff --git a/target/packages/as_devices/c/as_helpers.h b/target/packages/as_devices/c/as_helpers.h
index 6e6bf6e..535dba2 100644
--- a/target/packages/as_devices/c/as_helpers.h
+++ b/target/packages/as_devices/c/as_helpers.h
@@ -68,5 +68,18 @@ int as_read_buffer(int fd, char *buf, int size);
*/
int as_read_int(int fd, int *value_res);
+/** @brief return APF platform type
+ *
+ * @return APF_UNKNOWN/APF9328/APF27/APF51
+ */
+int as_helpers_get_platform(void);
+
+enum {
+ APF_UNKNOWN,
+ APF9328,
+ APF27,
+ APF51,
+};
+
#endif /* __ASHELPERS_H__ */
diff --git a/target/packages/as_devices/c/as_i2c.c b/target/packages/as_devices/c/as_i2c.c
index 3c607c2..9434f6f 100644
--- a/target/packages/as_devices/c/as_i2c.c
+++ b/target/packages/as_devices/c/as_i2c.c
@@ -221,7 +221,6 @@ int32_t as_i2c_read_msg(struct as_i2c_device *aDev,
uint8_t *aWData, uint8_t aWriteSize,
uint8_t *aRData, size_t aReadSize)
{
- int i;
/* write reg */
struct i2c_msg msg = { aDev->slave_addr, 0, aWriteSize, aWData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
diff --git a/target/packages/as_devices/cpp/as_gpio.cpp b/target/packages/as_devices/cpp/as_gpio.cpp
index e08d883..e3b5580 100644
--- a/target/packages/as_devices/cpp/as_gpio.cpp
+++ b/target/packages/as_devices/cpp/as_gpio.cpp
@@ -57,7 +57,7 @@ AsGpio::~AsGpio()
*
* @return error if negative value
*/
-long AsGpio::setPinDirection(int aDirection)
+long AsGpio::setPinDirection(char *aDirection)
{
if (mDev != NULL)
{
@@ -74,7 +74,7 @@ long AsGpio::setPinDirection(int aDirection)
*
* @return pin direction if positive or null, error if negative
*/
-long AsGpio::getPinDirection() const
+const char* AsGpio::getPinDirection() const
{
if (mDev != NULL)
{
@@ -83,7 +83,7 @@ long AsGpio::getPinDirection() const
else
{
std::cerr<<"AsGpio device structure not allocated"<<std::endl;
- return -1;
+ return NULL;
}
}
@@ -123,18 +123,17 @@ long AsGpio::getPinValue() const
}
}
-/** @brief Get pin value, blocking until interrupt occur
+/** @brief Get pin value, blocking until an interrupt/event occurs
*
- * @param aDelay_s waiting delay in seconds
- * @param aDelay_us waiting delay in useconds (plus delay in seconds)
+ * @param aDelay_ms waiting delay in milliseconds
*
* @return pin value if positive or null, read error if -1, timeout if -10
*/
-long AsGpio::blockingGetPinValue(int aDelay_s, int aDelay_us) const
+long AsGpio::waitEvent(int aDelay_ms) const
{
if (mDev != NULL)
{
- return as_gpio_blocking_get_pin_value(mDev, aDelay_s, aDelay_us);
+ return as_gpio_wait_event(mDev, aDelay_ms);
}
else
{
@@ -149,7 +148,7 @@ long AsGpio::blockingGetPinValue(int aDelay_s, int aDelay_us) const
*
* @return error if negative
*/
-long AsGpio::setIrqMode(int aMode)
+long AsGpio::setIrqMode(char* aMode)
{
if (mDev != NULL)
{
@@ -164,9 +163,9 @@ long AsGpio::setIrqMode(int aMode)
/** @brief Get pin irq mode value
*
- * @return pin mode value if positive or null, error if negative
+ * @return none/rising/falling/both
*/
-long AsGpio::getIrqMode() const
+const char* AsGpio::getIrqMode() const
{
if (mDev != NULL)
{
@@ -175,7 +174,7 @@ long AsGpio::getIrqMode() const
else
{
std::cerr<<"AsGpio device structure not allocated"<<std::endl;
- return -1;
+ return '?';
}
}
@@ -198,9 +197,9 @@ long AsGpio::getPinNum() const
/** @brief Get port letter
*
- * @return port letter, error if negative
+ * @return port letter
*/
-long AsGpio::getPortLetter() const
+char AsGpio::getPortLetter() const
{
if (mDev != NULL)
{
@@ -209,6 +208,7 @@ long AsGpio::getPortLetter() const
else
{
std::cerr<<"AsGpio device structure not allocated"<<std::endl;
- return -1;
+ return '?';
}
}
+
diff --git a/target/packages/as_devices/cpp/as_gpio.hpp b/target/packages/as_devices/cpp/as_gpio.hpp
index 017957f..cdd2966 100644
--- a/target/packages/as_devices/cpp/as_gpio.hpp
+++ b/target/packages/as_devices/cpp/as_gpio.hpp
@@ -31,19 +31,19 @@ public:
AsGpio(char aPortChar, int aPinNum);
virtual ~AsGpio();
- long setPinDirection(int aDirection);
- long getPinDirection() const;
+ long setPinDirection(char* aDirection);
+ const char* getPinDirection() const;
long setPinValue(int aValue);
long getPinValue() const;
- long blockingGetPinValue(int aDelay_s, int aDelay_us) const;
+ long waitEvent(int aDelay_ms) const;
- long setIrqMode(int aMode);
- long getIrqMode() const;
+ long setIrqMode(char* aMode);
+ const char* getIrqMode() const;
long getPinNum() const;
- long getPortLetter() const;
+ char getPortLetter() const;
protected:
mutable struct as_gpio_device *mDev;
diff --git a/target/packages/as_devices/main.c b/target/packages/as_devices/main.c
index fc46ea9..fb778fd 100644
--- a/target/packages/as_devices/main.c
+++ b/target/packages/as_devices/main.c
@@ -37,14 +37,14 @@ int main(int argc, char ** argv)
printf("* Testing program for as_devices library *\n");
printf("*******************************************************\n");
printf("Choose a test ('q' to quit):\n");
- printf(" 1) Testing pwm\n");
- printf(" 2) Testing i2c\n");
- printf(" 3) Testing spi\n");
- printf(" 4) Testing 93LCxx eprom\n");
- printf(" 5) Testing gpio\n");
- printf(" 6) Testing max1027\n");
- printf(" 7) Testing max5821\n");
- printf(" 8) Testing as1531\n");
+ printf(" 1) pwm\n");
+ printf(" 2) i2c\n");
+ printf(" 3) spi\n");
+ printf(" 4) 93LCxx eprom\n");
+ printf(" 5) gpio\n");
+ printf(" 6) max1027\n");
+ printf(" 7) max5821\n");
+ printf(" 8) as1531\n");
printf("> ");
scanf("%s",buffer);
diff --git a/target/packages/as_devices/python/Makefile b/target/packages/as_devices/python/Makefile
index 375b6e2..a3c22b5 100644
--- a/target/packages/as_devices/python/Makefile
+++ b/target/packages/as_devices/python/Makefile
@@ -23,8 +23,9 @@ WRAPPER_DIR=src
PYTHON_VERS=2.4
PYTHON_SUBVERS=5
+STAGING_DIR=$(ARMADEUS_STAGING_DIR)
PYINC=$(STAGING_DIR)/usr/include/python2.4/
-PYLIB=../../../../buildroot/project_build_armv5te/apf27/root/usr/lib/python$(PYTHON_VERS)
+PYLIB=$(ARMADEUS_TARGET_DIR)/usr/lib/python$(PYTHON_VERS)
.PHONY: all
diff --git a/target/packages/as_devices/python/src/AsGpio_wrap.c b/target/packages/as_devices/python/src/AsGpio_wrap.c
index 8073c99..9f6472a 100644
--- a/target/packages/as_devices/python/src/AsGpio_wrap.c
+++ b/target/packages/as_devices/python/src/AsGpio_wrap.c
@@ -84,7 +84,7 @@ static PyObject * gpio_open(PyObject *self, PyObject *args)
/** @brief Set pin direction
*
* @param aFdev as_gpio_device structure pointer
- * @param aDirection direction 0:input 1:output
+ * @param aDirection direction "in" / "out"
*
* @return error if negative value
*/
@@ -92,12 +92,12 @@ static PyObject * setPinDirection(PyObject *self, PyObject *args)
{
/* parameters */
struct as_gpio_device *aFdev;
- int aDirection;
+ char* aDirection;
int ret;
/* Get arguments */
- if (!PyArg_ParseTuple(args, "li",
+ if (!PyArg_ParseTuple(args, "ls",
(long *)&aFdev,
&aDirection))
{
@@ -122,7 +122,7 @@ static PyObject * getPinDirection(PyObject *self, PyObject *args)
/* parameters */
struct as_gpio_device *aFdev;
- int ret;
+ const char* dir;
/* Get arguments */
if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
@@ -132,15 +132,15 @@ static PyObject * getPinDirection(PyObject *self, PyObject *args)
return NULL;
}
- ret = as_gpio_get_pin_direction(aFdev);
- if (ret < 0)
+ dir = as_gpio_get_pin_direction(aFdev);
+ if (strcmp(dir, "??"))
{
PyErr_SetString(PyExc_IOError,
"Can't get pin direction");
return NULL;
}
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("s", dir);
}
/** @brief Set pin value
@@ -223,23 +223,21 @@ static PyObject * blockingGetPinValue(PyObject *self, PyObject *args)
{
/* parameters */
struct as_gpio_device *aFdev;
- int aDelay_s;
- int aDelay_us;
+ int aDelay_ms;
int ret;
/* Get arguments */
- if (!PyArg_ParseTuple(args, "lii",
+ if (!PyArg_ParseTuple(args, "li",
(long *)&aFdev,
- &aDelay_s,
- &aDelay_us))
+ &aDelay_ms))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
return NULL;
}
- ret = as_gpio_blocking_get_pin_value(aFdev, aDelay_s, aDelay_us);
+ ret = as_gpio_wait_event(aFdev, aDelay_ms);
if (ret == -10)
{
PyErr_SetString(PyExc_IOError, "TIMEOUT");
@@ -266,12 +264,12 @@ static PyObject * setIrqMode(PyObject *self, PyObject *args)
{
/* parameters */
struct as_gpio_device *aFdev;
- int aMode;
+ char *aMode;
int ret;
/* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aMode))
+ if (!PyArg_ParseTuple(args, "ls", (long *)&aFdev, &aMode))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
@@ -293,14 +291,14 @@ static PyObject * setIrqMode(PyObject *self, PyObject *args)
*
* @param aFDev as_gpio_device pointer structure
*
- * @return pin mode value if positive or null, error if negative
+ * @return pin mode ("falling"/"rising"/"both"/"none")
*/
static PyObject * getIrqMode(PyObject *self, PyObject *args)
{
/* parameters */
struct as_gpio_device *aFdev;
- int ret;
+ const char *mode;
/* Get arguments */
if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
@@ -310,15 +308,15 @@ static PyObject * getIrqMode(PyObject *self, PyObject *args)
return NULL;
}
- ret = as_gpio_get_irq_mode(aFdev);
- if (ret < 0)
+ mode = as_gpio_get_irq_mode(aFdev);
+ if (strcmp(mode, "??"))
{
PyErr_SetString(PyExc_IOError,
"Can't get pin value");
return NULL;
}
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("s", mode);
}
/** @brief Get pin number value
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index 5adf7ff..9a1def3 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -1,7 +1,6 @@
/*
- ** THE ARMadeus Systems
**
- ** Copyright (C) 2009 The armadeus systems team
+ ** Copyright (C) 2009-2011 The Armadeus Project - ARMadeus Systems
** Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
@@ -16,7 +15,7 @@
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
- ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
@@ -31,6 +30,7 @@
#include "as_max5821.h"
#include "as_adc.h"
#include "as_dac.h"
+#include "as_helpers.h"
#define PWM_NUM 0
@@ -442,7 +442,25 @@ void test_gpio()
int pin_num = 13;
int port_direction = 0;
int port_value = 1;
-
+ int platform;
+
+ platform = as_helpers_get_platform();
+ switch (platform) {
+ case APF9328:
+ port_letter = 'X';
+ pin_num = 0x007;
+ break;
+ case APF27:
+ port_letter = 'F';
+ pin_num = 13;
+ break;
+ case APF51:
+ port_letter = 'A';
+ pin_num = 3;
+ break;
+ default:
+ break;
+ }
gpio_dev = as_gpio_open(port_letter, pin_num);
if (gpio_dev == NULL)
{
@@ -463,22 +481,21 @@ void test_gpio()
{
system("clear");
printf("**************************\n");
- printf(" Testing GPIO P%c%d \n", as_gpio_get_port_letter(gpio_dev),
- as_gpio_get_pin_num(gpio_dev));
+ printf(" Testing GPIO Port%c%d \n", port_letter, pin_num);
printf("**************************\n");
printf("Choose ('q' to quit):\n");
printf(" 1) Change gpio (P%c%d)\n", as_gpio_get_port_letter(gpio_dev),
as_gpio_get_pin_num(gpio_dev));
- printf(" 2) Change direction (%d)\n", as_gpio_get_pin_direction(gpio_dev));
+ printf(" 2) Change direction (%s)\n", as_gpio_get_pin_direction(gpio_dev));
printf(" 3) Change value (%d)\n", as_gpio_get_pin_value(gpio_dev));
printf(" 4) Read pin value\n");
- printf(" 5) Set irq mode (%d)\n", as_gpio_get_irq_mode(gpio_dev));
- printf(" a) blocking read\n");
+ printf(" 5) Set irq/event mode (%s)\n", as_gpio_get_irq_mode(gpio_dev));
+ printf(" a) Wait an event\n");
printf("> ");
scanf("%s",buffer);
- switch(buffer[0])
+ switch (buffer[0])
{
case '1' : printf("Give letter of port in upper case : ");
scanf("%s", buffer);
@@ -498,7 +515,7 @@ void test_gpio()
scanf("%d", &pin_num);
gpio_dev = as_gpio_open(port_letter,pin_num);
- if(gpio_dev == NULL)
+ if (gpio_dev == NULL)
{
printf("Error, can't open P%c%d\n", port_letter, pin_num);
pressEnterToContinue();
@@ -507,10 +524,10 @@ void test_gpio()
printf("Ok P%c%d is open\n", port_letter, pin_num);
pressEnterToContinue();
break;
- case '2' : printf("Give direction (0:in, 1:out) : ");
- scanf("%d", &value);
- ret = as_gpio_set_pin_direction(gpio_dev, value);
- if(ret < 0)
+ case '2' : printf("Give direction (in/out) : ");
+ scanf("%s", buffer);
+ ret = as_gpio_set_pin_direction(gpio_dev, buffer);
+ if (ret < 0)
{
printf("Error, can't change direction\n");
pressEnterToContinue();
@@ -523,7 +540,7 @@ void test_gpio()
case '3' : printf("Give value : ");
scanf("%d", &value);
ret = as_gpio_set_pin_value(gpio_dev, value);
- if(ret < 0)
+ if (ret < 0)
{
printf("Error, can't change pin value\n");
pressEnterToContinue();
@@ -544,18 +561,12 @@ void test_gpio()
port_value = ret;
pressEnterToContinue();
break;
- case '5' : printf("1) GPIO_IRQ_MODE_NOINT \n");
- printf("2) GPIO_IRQ_MODE_RISING \n");
- printf("3) GPIO_IRQ_MODE_FALLING\n");
- printf("4) GPIO_IRQ_MODE_BOTH \n");
- printf("Give value : ");
- scanf("%d", &value);
- if (value == 1)value = GPIO_IRQ_MODE_NOINT ;
- if (value == 2)value = GPIO_IRQ_MODE_RISING ;
- if (value == 3)value = GPIO_IRQ_MODE_FALLING;
- if (value == 4)value = GPIO_IRQ_MODE_BOTH ;
- ret = as_gpio_set_irq_mode(gpio_dev, value);
- if(ret < 0)
+ case '5':
+ printf("rising / falling / both / none\n");
+ printf("Please choose a mode : ");
+ scanf("%s", buffer);
+ ret = as_gpio_set_irq_mode(gpio_dev, buffer);
+ if (ret < 0)
{
printf("Error, can't change irq value\n");
pressEnterToContinue();
@@ -564,8 +575,8 @@ void test_gpio()
printf("Ok value changed\n");
pressEnterToContinue();
break;
- case 'a' : printf("Blocking read \n");
- ret = as_gpio_blocking_get_pin_value(gpio_dev, 10, 0);
+ case 'a' : printf("Blocking read (10 sec timeout)\n");
+ ret = as_gpio_wait_event(gpio_dev, 10000);
if (ret < 0)
{
printf("Error, can't read value\n");
@@ -628,7 +639,7 @@ void test_max1027()
{
switch(buffer[0])
{
- case '1' : printf("Open Max 1027 device\n");
+ case '1' : printf("Open MAX1027 device\n");
max1027_dev = as_adc_open(AS_MAX1027_NAME, devNumber, vRef);
if (max1027_dev < 0)
{
@@ -656,7 +667,7 @@ void test_max1027()
{
switch(buffer[0])
{
- case '1' : printf("Close Max 1027 device\n");
+ case '1' : printf("Close MAX1027 device\n");
ret = as_adc_close(max1027_dev);
if (ret < 0)
{
@@ -824,4 +835,3 @@ void test_as1531(void)
pressEnterToContinue();
}
-
diff --git a/target/packages/as_devices/test_cpp.h b/target/packages/as_devices/test_cpp.h
index 3d49a44..f39944e 100644
--- a/target/packages/as_devices/test_cpp.h
+++ b/target/packages/as_devices/test_cpp.h
@@ -146,14 +146,14 @@ void test_gpio()
{
system("clear");
printf("**************************\n");
- printf(" Testing GPIO P%c%d \n", gpio_dev->getPortLetter(), gpio_dev->getPinNum());
+ printf(" Testing GPIO Port%c%d \n", gpio_dev->getPortLetter(), gpio_dev->getPinNum());
printf("**************************\n");
printf("Choose ('q' to quit):\n");
printf(" 1) Change gpio (P%c%d)\n", gpio_dev->getPortLetter(), gpio_dev->getPinNum());
- printf(" 2) Change direction (%d)\n", gpio_dev->getPinDirection());
+ printf(" 2) Change direction (%s)\n", gpio_dev->getPinDirection());
printf(" 3) Change value (%d)\n", gpio_dev->getPinValue());
printf(" 4) Read pin value\n");
- printf(" 5) Set irq mode (%d)\n", gpio_dev->getIrqMode());
+ printf(" 5) Set irq mode (%s)\n", gpio_dev->getIrqMode());
printf(" a) blocking read\n");
printf("> ");
@@ -182,10 +182,10 @@ void test_gpio()
printf("Ok P%c%d is open\n", port_letter, pin_num);
pressEnterToContinue();
break;
- case '2' : printf("Give direction (0:in, 1:out) : ");
- scanf("%d", &value);
- ret = gpio_dev->setPinDirection(value);
- if(ret < 0)
+ case '2' : printf("Give direction (in / out) : ");
+ scanf("%s", buffer);
+ ret = gpio_dev->setPinDirection(buffer);
+ if (ret < 0)
{
printf("Error, can't change direction\n");
pressEnterToContinue();
@@ -219,18 +219,12 @@ void test_gpio()
port_value = ret;
pressEnterToContinue();
break;
- case '5' : printf("1) GPIO_IRQ_MODE_NOINT \n");
- printf("2) GPIO_IRQ_MODE_RISING \n");
- printf("3) GPIO_IRQ_MODE_FALLING\n");
- printf("4) GPIO_IRQ_MODE_BOTH \n");
- printf("Give value : ");
- scanf("%d", &value);
- if (value == 1)value = GPIO_IRQ_MODE_NOINT ;
- if (value == 2)value = GPIO_IRQ_MODE_RISING ;
- if (value == 3)value = GPIO_IRQ_MODE_FALLING;
- if (value == 4)value = GPIO_IRQ_MODE_BOTH ;
- ret = gpio_dev->setIrqMode(value);
- if(ret < 0)
+ case '5' :
+ printf("rising / falling / both / none\n");
+ printf("Please choose a mode : ");
+ scanf("%s", buffer);
+ ret = gpio_dev->setIrqMode(buffer);
+ if (ret < 0)
{
printf("Error, can't change irq value\n");
pressEnterToContinue();
@@ -239,8 +233,8 @@ void test_gpio()
printf("Ok value changed\n");
pressEnterToContinue();
break;
- case 'a' : printf("Blocking read \n");
- ret = gpio_dev->blockingGetPinValue(10, 0);
+ case 'a' : printf("Blocking read (10 sec timeout)\n");
+ ret = gpio_dev->waitEvent(10000);
if (ret < 0)
{
printf("Error, can't read value\n");
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-18 17:44:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 7cb4f61d238e7614b990f1a24c434b50b46201e0 (commit)
from 5352523ef5a7d13849feea49a9af3902ed15a00b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7cb4f61d238e7614b990f1a24c434b50b46201e0
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 18 19:44:06 2011 +0200
[LINUX] APF51: Add init for PMIC GPIO6
-----------------------------------------------------------------------
Summary of changes:
.../2.6.38/400-armadeus-add_apf51_module.patch | 22 ++++++++++---------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index 3f576d0..bc9683d 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,7 +1,7 @@
Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-17 14:45:14.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-17 15:22:10.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-18 16:21:54.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-18 19:34:48.000000000 +0200
@@ -162,4 +162,16 @@
Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals.
@@ -21,8 +21,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-05-17 14:44:47.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-17 15:22:10.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-18 19:34:48.000000000 +0200
@@ -7,6 +7,7 @@
obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
@@ -34,8 +34,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-05-17 14:45:17.000000000 +0200
-@@ -0,0 +1,495 @@
++++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-05-18 19:32:31.000000000 +0200
+@@ -0,0 +1,497 @@
+/*
+ * Support for APF51 System On Module
+ * Copyright (C) 2010-2011 Armadeus Systems <su...@ar...>
@@ -380,6 +380,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
+ int ret = 0;
+
+ printk("--- %s 0x%08x\n", __func__, wm831x_reg_read(wm831x, WM831X_INTERRUPT_STATUS_2_MASK));
++ /* Configure GPIO6: input, pwdmn 0, inverted, CMOS, enable, pullup */
++ wm831x_reg_write(wm831x, WM831X_GPIO6_CONTROL, 0xc080);
+
+ return ret;
+}
@@ -533,8 +535,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-17 14:45:16.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-17 14:45:17.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-18 16:21:55.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-18 16:21:56.000000000 +0200
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -555,8 +557,8 @@ Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
}
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-17 14:45:16.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-17 15:23:51.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-18 16:21:55.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-18 16:21:56.000000000 +0200
@@ -53,6 +53,8 @@
#define MXC_BOARD_IRQS 80
#elif defined CONFIG_MACH_APF27
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-18 14:50:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 5352523ef5a7d13849feea49a9af3902ed15a00b (commit)
via 078fc2c56bb529b86fcdf969b2e4dc33f3dbaedc (commit)
from 23232f3d21dda09ec9e445e21aaceaf2e8f971c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5352523ef5a7d13849feea49a9af3902ed15a00b
Author: Kevin Joly <kev...@ar...>
Date: Wed May 18 16:48:39 2011 +0200
[LINUX] 2.6.38: Add fix for mcp251x to prevent CAN messages re-emission when CS stays low too long
commit 078fc2c56bb529b86fcdf969b2e4dc33f3dbaedc
Author: Kevin Joly <kev...@ar...>
Date: Wed May 18 16:03:51 2011 +0200
[TEST] Add a test for CAN bus
-----------------------------------------------------------------------
Summary of changes:
...32-armadeus-mcp2525-fix_spi_module_errata.patch | 43 +++++++++
target/test/test_can.sh | 98 ++++++++++++++++++++
2 files changed, 141 insertions(+), 0 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/432-armadeus-mcp2525-fix_spi_module_errata.patch
create mode 100755 target/test/test_can.sh
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/432-armadeus-mcp2525-fix_spi_module_errata.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/432-armadeus-mcp2525-fix_spi_module_errata.patch
new file mode 100644
index 0000000..8f0f54d
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/432-armadeus-mcp2525-fix_spi_module_errata.patch
@@ -0,0 +1,43 @@
+Fix mcp251x's SPI module errata: use workaround preconized by Microchip, ie
+send the "SPI RTS" command to prevent the CAN message to be repeated if CS#
+stays low after a SPI command.
+
+Signed-off-by: Kevin JOLY <jol...@gm...>
+
+Index: linux-2.6.38.1/drivers/net/can/mcp251x.c
+===================================================================
+--- linux-2.6.38.1.orig/drivers/net/can/mcp251x.c 2011-05-16 09:49:26.751359999 +0200
++++ linux-2.6.38.1/drivers/net/can/mcp251x.c 2011-05-16 09:42:27.000000000 +0200
+@@ -83,6 +83,7 @@
+ #define INSTRUCTION_LOAD_TXB(n) (0x40 + 2 * (n))
+ #define INSTRUCTION_READ_RXB(n) (((n) == 0) ? 0x90 : 0x94)
+ #define INSTRUCTION_RESET 0xC0
++#define INSTRUCTION_RTS(n) (0x80 + (1<<(n)))
+
+ /* MPC251x registers */
+ #define CANSTAT 0x0e
+@@ -377,6 +378,15 @@
+ mcp251x_spi_trans(spi, 4);
+ }
+
++static void mcp251x_send_rts(struct spi_device *spi, int tx_buf_idx)
++{
++ struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
++
++ priv->spi_tx_buf[0] = INSTRUCTION_RTS(tx_buf_idx);
++
++ mcp251x_spi_trans(spi, 1);
++}
++
+ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf,
+ int len, int tx_buf_idx)
+ {
+@@ -418,7 +428,7 @@
+ buf[TXBDLC_OFF] = (rtr << DLC_RTR_SHIFT) | frame->can_dlc;
+ memcpy(buf + TXBDAT_OFF, frame->data, frame->can_dlc);
+ mcp251x_hw_tx_frame(spi, buf, frame->can_dlc, tx_buf_idx);
+- mcp251x_write_reg(spi, TXBCTRL(tx_buf_idx), TXBCTRL_TXREQ);
++ mcp251x_send_rts(spi, tx_buf_idx);
+ }
+
+ static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
diff --git a/target/test/test_can.sh b/target/test/test_can.sh
new file mode 100755
index 0000000..c32e269
--- /dev/null
+++ b/target/test/test_can.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2011 The Armadeus Project - ARMadeus Systems
+#
+# 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.
+#
+
+source ./test_helpers.sh
+
+show_connection()
+{
+ if [ "$1" == "APF27" ]; then
+ echo "======== APF 27 ========"
+ echo "CAN bus connector:"
+ echo "__________"
+ echo "| * * * * |"
+ echo "--4-3-2-1--"
+ echo ""
+ echo "Please shortcut J11 jumper and connect the second node on the CAN bus:"
+ echo "-4 on GND"
+ echo "-3 on CANL"
+ echo "-2 on CANH"
+ ask_user "Then press ENTER"
+ elif [ "$1" == "APF51" ]; then
+ echo "======== APF 51 ========"
+ echo "CAN bus connector:"
+ echo "__7_5_3_1_"
+ echo "| * * * * |"
+ echo "| * * * * |"
+ echo "--8-6-4-2--"
+ echo ""
+ echo "Please shortcut 7 with 8 and connect the second node on the CAN bus:"
+ echo "-6 on GND"
+ echo "-3 on CANL"
+ echo "-4 on CANH"
+ ask_user "Then press ENTER"
+ else
+ echo "Platform not supported by this test"
+ exit_failed
+ fi
+}
+
+test_can()
+{
+ show_test_banner "CAN bus"
+
+ execute_for_target show_connection
+ message_sent=0
+ message_received=0
+
+ modprobe can && modprobe can-dev && modprobe can-raw && modprobe mcp251x
+ if [ "$?" != 0 ]; then
+ echo "Some modules failed to load"
+ exit_failed
+ fi
+
+ echo $(ip link set can0 up type can bitrate 125000)
+
+ candump can0 -l -s 2 &
+ echo $(cansend can0 280#R)
+ echo "Please wait..."
+ sleep 1
+
+ killall candump
+
+ for line in $(cat candump-*.log); do
+ echo "$line"
+
+ if [ "$line" = "280#R" ]; then
+ message_sent=1
+ fi
+
+ if [ "$line" = "280#" ]; then
+ message_received=1
+ fi
+ done
+
+ rm $(ls candump-*.log)
+ rmmod mcp251x
+ rmmod can-dev
+ rmmod can-raw
+ rmmod can
+
+ if [[ $message_sent -eq 1 && $message_received -eq 1 ]]; then
+ echo_test_ok
+ exit 0
+ else
+ exit_failed
+ fi
+}
+
+test_can
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-18 10:38:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 23232f3d21dda09ec9e445e21aaceaf2e8f971c9 (commit)
via d3cd7f21e9a0bd9cb1a9950cff37a3971b09d9cc (commit)
from 60f9b13b7a8ad23549c55144f7a16f8ee0d048fc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 23232f3d21dda09ec9e445e21aaceaf2e8f971c9
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 18 12:37:36 2011 +0200
[LINUX] APF27: Change FPGA resources declaration (2.6.29 & 2.6.38) to mimic APF51
commit d3cd7f21e9a0bd9cb1a9950cff37a3971b09d9cc
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 17:24:01 2011 +0200
Indentation (Lindent)
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf27/apf27-linux-2.6.29.config | 3 +-
.../armadeus/apf27/apf27-linux-2.6.38.config | 3 +-
.../2.6.29/281-apf27-armadeus-add_apf27.c.patch | 77 ++++----------------
...-apf27-armadeus-add_apf27_to_build_system.patch | 18 ++---
...291-apf27-armadeus-add_mach_board-apf27_h.patch | 25 +------
.../322-apf27-armadeus-add_mach_fpga_h.patch | 38 +++++-----
.../2.6.38/281-apf27-armadeus-add_apf27.c.patch | 70 ++----------------
...-apf27-armadeus-add_apf27_to_build_system.patch | 20 ++----
.../322-apf27-armadeus-add_mach_fpga_h.patch | 5 +-
.../fpga/dev_tools/loader/apf27-fpga-loader.c | 40 +++++++----
.../wishbone_example/wb_irq_mngr/board_irq_mng.c | 20 +++++-
.../fpga/wishbone_example/wb_irq_mngr/main.c | 9 ++-
12 files changed, 110 insertions(+), 218 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
index 51a87d1..76b117a 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29.6
-# Wed Mar 2 18:33:57 2011
+# Wed May 18 11:57:38 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -186,7 +186,6 @@ CONFIG_MACH_MX27=y
# MX2 Platforms
#
CONFIG_MACH_APF27=y
-CONFIG_MACH_APF27_FPGA=y
# CONFIG_MACH_MX27ADS is not set
# CONFIG_MACH_PCM038 is not set
# CONFIG_MACH_PCM970_BASEBOARD is not set
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
index 70346da..5be812f 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Tue May 10 13:46:36 2011
+# Wed May 18 12:19:19 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -287,7 +287,6 @@ CONFIG_MACH_MX27=y
# CONFIG_MACH_PCA100 is not set
# CONFIG_MACH_MXT_TD60 is not set
CONFIG_MACH_APF27=y
-CONFIG_MACH_APF27_FPGA=y
CONFIG_MACH_APF27_HAS_BASEBOARD=y
CONFIG_MACH_APF27_DEV=y
CONFIG_MACH_APF27_DEV_EXT_NONE=y
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
index ab4a3df..25876e1 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/281-apf27-armadeus-add_apf27.c.patch
@@ -9,14 +9,14 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27.c 2010-07-28 10:43:04.000000000 +0200
-@@ -0,0 +1,789 @@
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27.c 2011-05-18 11:27:34.000000000 +0200
+@@ -0,0 +1,739 @@
+ /*
+ * apf27.c
+ *
+ * Support for the APF27 System On Module
+ *
-+ * Copyright (C) 2008 Armadeus Systems
++ * Copyright (C) 2008-2011 ARMadeus Systems
+ * Authors: Julien Boibessot <jul...@ar...>
+ * Eric Jarrige <eri...@ar...>
+ *
@@ -40,7 +40,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
-+#include <asm/mach/flash.h>
+#include <linux/i2c.h>
+#include <linux/serial.h>
+#include <linux/delay.h>
@@ -48,6 +47,9 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#include <linux/cpufreq.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
++#include <linux/fsl_devices.h> /* USB device */
++
++#include <asm/mach/flash.h>
+#include <asm/io.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
@@ -62,16 +64,13 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#include <mach/mxc_nand.h>
+#include <mach/mxc_ehci.h>
+#include <mach/ulpi.h>
-+#include <linux/fsl_devices.h> /* USB device */
+#include "../../../drivers/armadeus/pwm/pwm.h"
+#if defined(CONFIG_CPU_FREQ_IMX27) || defined(CONFIG_CPU_FREQ_IMX27_MODULE)
+#include "cpufreq_imx.h"
+#endif
+#include <mach/board-apf27.h>
+#include <asm/mach/map.h>
-+#ifdef CONFIG_MACH_APF27_FPGA
-+#include <mach/fpga.h>
-+#endif
++
+#include "devices.h"
+#include "crm_regs.h"
+
@@ -686,41 +685,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+};
+
+
-+/* APF27 has an optional Spartan3A FPGA connected to i.MX27 address/data
-+ busses */
-+#ifdef CONFIG_MACH_APF27_FPGA
-+static int fpga_pins[] = {
-+ (APF27_FPGA_INT_PIN | GPIO_IN | GPIO_GPIO),
-+};
-+
-+static int apf27_fpga_irq_init(struct platform_device *pdev)
-+{
-+ int res;
-+
-+ res = mxc_gpio_setup_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins), "FPGA");
-+ if (!res)
-+ set_irq_type(APF27_FPGA_IRQ, IRQ_TYPE_EDGE_RISING);
-+
-+ return res;
-+}
-+
-+static void apf27_fpga_irq_exit(struct platform_device *pdev)
-+{
-+ mxc_gpio_release_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins));
-+}
-+
-+struct fpga_irq_mng_platform_data apf27_fpga_irq = {
-+ .init = apf27_fpga_irq_init,
-+ .exit = apf27_fpga_irq_exit,
-+};
-+
-+struct platform_device apf27_ocore_irq_mng_device = {
-+ .name = "ocore_irq_mng",
-+ .id = 0,
-+};
-+#endif /* CONFIG_MACH_APF27_FPGA */
-+
-+
+static void __init apf27_init(void)
+{
+ sysdev_class_register(&apf27_pm_sysclass);
@@ -756,10 +720,6 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#endif
+ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+
-+#ifdef CONFIG_MACH_APF27_FPGA
-+ mxc_register_device(&apf27_ocore_irq_mng_device, &apf27_fpga_irq);
-+#endif
-+
+ printk("i.MX27 chip revision: %d\n", mx27_revision() );
+
+ apf27_baseboard_init();
@@ -775,19 +735,9 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ .init = apf27_timer_init,
+};
+
-+static struct map_desc apf27_io_desc[] __initdata = {
-+ {
-+ .virtual = CS5_BASE_ADDR_VIRT,
-+ .pfn = __phys_to_pfn(CS5_BASE_ADDR),
-+ .length = CS5_SIZE,
-+ .type = MT_DEVICE,
-+ },
-+};
-+
+void __init apf27_map_io(void)
+{
+ mxc_map_io();
-+ iotable_init(apf27_io_desc, ARRAY_SIZE(apf27_io_desc));
+}
+
+MACHINE_START(APF27, "Armadeus APF27")
@@ -803,8 +753,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2010-07-28 10:59:04.000000000 +0200
-@@ -0,0 +1,1139 @@
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2011-05-18 11:28:20.000000000 +0200
+@@ -0,0 +1,1138 @@
+ /*
+ * apf27-dev.c
+ * Support for AFP27 module's development baseboard
@@ -839,6 +789,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+#include <linux/cpufreq.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
++
+#include <asm/io.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
@@ -877,9 +828,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
+#endif
+#include <mach/board-apf27.h>
+#include <asm/mach/map.h>
-+#ifdef CONFIG_MACH_APF27_FPGA
-+#include <mach/fpga.h>
-+#endif
++
+#include "devices.h"
+#include "crm_regs.h"
+
@@ -1947,7 +1896,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c 2010-07-28 10:43:04.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c 2011-05-18 11:27:34.000000000 +0200
@@ -0,0 +1,220 @@
+/*
+ * apf27-lcd.c
@@ -2172,7 +2121,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c
Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c 2010-07-28 10:43:04.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c 2011-05-18 11:27:34.000000000 +0200
@@ -0,0 +1,190 @@
+ /*
+ * apf27-dev-ext-apw.c
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/282-apf27-armadeus-add_apf27_to_build_system.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/282-apf27-armadeus-add_apf27_to_build_system.patch
index 1b3ce65..444f97f 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/282-apf27-armadeus-add_apf27_to_build_system.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/282-apf27-armadeus-add_apf27_to_build_system.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.29.6/arch/arm/mach-mx2/Kconfig
===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/Kconfig 2009-12-15 19:54:59.000000000 +0100
-+++ linux-2.6.29.6/arch/arm/mach-mx2/Kconfig 2009-12-16 10:34:20.000000000 +0100
-@@ -10,6 +10,21 @@
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/Kconfig 2011-05-18 11:28:48.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/Kconfig 2011-05-18 11:57:01.000000000 +0200
+@@ -10,6 +10,15 @@
comment "MX2 Platforms"
depends on ARCH_MX2
@@ -15,16 +15,10 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/Kconfig
+ Include support for APF27 platform. This includes specific
+ configurations for the module and its peripherals.
+
-+config MACH_APF27_FPGA
-+ bool "board has a FPGA"
-+ depends on MACH_APF27
-+ help
-+ Select this if your APF27 has an onboard FPGA.
-+
config MACH_MX27ADS
bool "MX27ADS platform"
depends on MACH_MX27
-@@ -26,15 +41,98 @@
+@@ -26,15 +35,98 @@
choice
prompt "Baseboard"
@@ -126,8 +120,8 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/Kconfig
+
Index: linux-2.6.29.6/arch/arm/mach-mx2/Makefile
===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/Makefile 2009-12-15 19:54:59.000000000 +0100
-+++ linux-2.6.29.6/arch/arm/mach-mx2/Makefile 2009-12-16 10:19:31.000000000 +0100
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/Makefile 2011-05-18 11:28:48.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/Makefile 2011-05-18 11:56:17.000000000 +0200
@@ -10,6 +10,10 @@
obj-$(CONFIG_MACH_MX27) += clock_imx27.o
obj-$(CONFIG_CPU_FREQ_IMX27) += cpufreq_imx27.o
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/291-apf27-armadeus-add_mach_board-apf27_h.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/291-apf27-armadeus-add_mach_board-apf27_h.patch
index 7ce02f9..d7e8578 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/291-apf27-armadeus-add_mach_board-apf27_h.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/291-apf27-armadeus-add_mach_board-apf27_h.patch
@@ -1,10 +1,10 @@
-Index: linux-2.6.29/arch/arm/plat-mxc/include/mach/board-apf27.h
+Index: linux-2.6.29.6/arch/arm/plat-mxc/include/mach/board-apf27.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29/arch/arm/plat-mxc/include/mach/board-apf27.h 2009-04-14 18:34:53.000000000 +0200
-@@ -0,0 +1,45 @@
++++ linux-2.6.29.6/arch/arm/plat-mxc/include/mach/board-apf27.h 2011-05-18 10:02:40.000000000 +0200
+@@ -0,0 +1,28 @@
+/*
-+ * Copyright (C) 2008 Armadeus Systems
++ * Copyright (C) 2008-2011 ARMadeus Systems
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
@@ -24,27 +24,10 @@ Index: linux-2.6.29/arch/arm/plat-mxc/include/mach/board-apf27.h
+#ifndef __ASM_ARCH_MXC_BOARD_APF27_H__
+#define __ASM_ARCH_MXC_BOARD_APF27_H__
+
-+
+#include <mach/iomux-mx1-mx2.h>
+
+/* mandatory for CONFIG_LL_DEBUG */
+#define MXC_LL_UART_PADDR UART1_BASE_ADDR
+#define MXC_LL_UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
+
-+/* CS5 */
-+#define CS5_BASE_ADDR_VIRT 0xF4300000
-+#define CS5_SIZE SZ_1M
-+
-+/* FPGA addresses */
-+#define APF27_FPGA_VIRT (CS5_BASE_ADDR_VIRT)
-+#define APF27_FPGA_PHYS (CS5_BASE_ADDR)
-+#define ARMADEUS_FPGA_BASE_ADDR_VIRT (APF27_FPGA_VIRT)
-+#define ARMADEUS_FPGA_BASE_ADDR_PHYS (APF27_FPGA_PHYS)
-+
-+/* FPGA IRQ */
-+#define APF27_FPGA_INT_PIN (GPIO_PORTF | 12)
-+#define APF27_FPGA_IRQ (IRQ_GPIOF(12))
-+#define ARMADEUS_FPGA_IRQ (APF27_FPGA_IRQ)
-+
-+
+#endif /* __ASM_ARCH_MXC_BOARD_APF27_H__ */
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/322-apf27-armadeus-add_mach_fpga_h.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/322-apf27-armadeus-add_mach_fpga_h.patch
index 1e129a6..1e1e8fc 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/322-apf27-armadeus-add_mach_fpga_h.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/322-apf27-armadeus-add_mach_fpga_h.patch
@@ -1,10 +1,10 @@
-Index: linux-2.6.29.4/arch/arm/plat-mxc/include/mach/fpga.h
+Index: linux-2.6.29.6/arch/arm/plat-mxc/include/mach/fpga.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.4/arch/arm/plat-mxc/include/mach/fpga.h 2009-06-08 17:40:21.000000000 +0200
++++ linux-2.6.29.6/arch/arm/plat-mxc/include/mach/fpga.h 2011-05-18 10:01:49.000000000 +0200
@@ -0,0 +1,43 @@
+/*
-+ * Copyright (C) 2009 Armadeus Systems
++ * Copyright (C) 2009-2011 ARMadeus Systems
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
@@ -24,25 +24,25 @@ Index: linux-2.6.29.4/arch/arm/plat-mxc/include/mach/fpga.h
+#ifndef __ASM_ARCH_ARMADEUS_FPGA_H__
+#define __ASM_ARCH_ARMADEUS_FPGA_H__
+
++#ifndef CONFIG_MACH_APF9328
++# include <mach/irqs.h>
++# include <mach/gpio.h>
++#endif
++#include <mach/iomux-mx1-mx2.h>
+
-+#ifdef CONFIG_MACH_APF27
-+#include <mach/board-apf27.h> /* @ are here */
-+#include <mach/irqs.h>
++#if defined(CONFIG_MACH_APF27) /* */
++# define APF27_FPGA_BASE_ADDR 0xd6000000
++# define ARMADEUS_FPGA_BASE_ADDR APF27_FPGA_BASE_ADDR
++# define APF27_FPGA_INT_PIN (GPIO_PORTF | 12)
++# define APF27_FPGA_IRQ (IRQ_GPIOF(12))
++# define ARMADEUS_FPGA_IRQ APF27_FPGA_IRQ
++# define IRQ_FPGA_START MXC_BOARD_IRQ_START
++#elif defined(CONFIG_MACH_APF9328) /* */
++# define APF9328_FPGA_BASE_ADDR 0x12000000
++# define ARMADEUS_FPGA_BASE_ADDR APF9328_FPGA_BASE_ADDR
+#else
-+/* To complete when MX1 platform merged */
++# error "Unsupported platform"
+#endif
-+#include <linux/platform_device.h>
+
-+/* FPGA interrupts number */
-+#ifdef CONFIG_MACH_APF27
-+#define IRQ_FPGA_START (MXC_BOARD_IRQ_START)
-+#endif
+#define IRQ_FPGA(x) (IRQ_FPGA_START + x)
-+#define NR_IRQS_FPGA (MXC_BOARD_IRQS)
-+
-+struct fpga_irq_mng_platform_data {
-+ int (*init)(struct platform_device*);
-+ void (*exit)(struct platform_device*);
-+};
-+
+#endif /* __ASM_ARCH_ARMADEUS_FPGA_H__ */
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
index 8126a2d..a5c441a 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
@@ -12,8 +12,8 @@ Signed-off-by: Kevin Joly <jol...@gm...>
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27.c 2011-05-10 14:19:07.000000000 +0200
-@@ -0,0 +1,728 @@
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27.c 2011-05-17 22:34:43.000000000 +0200
+@@ -0,0 +1,675 @@
+ /*
+ * apf27.c
+ *
@@ -77,9 +77,6 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
+#endif
+//#include <mach/board-apf27.h>
+#include <asm/mach/map.h>
-+#ifdef CONFIG_MACH_APF27_FPGA
-+#include <mach/fpga.h>
-+#endif
+#include <mach/mx27.h>
+
+#include "devices-imx27.h"
@@ -613,49 +610,6 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
+};
+
+
-+/* APF27 has an optional Spartan3A FPGA connected to i.MX27 address/data
-+ busses */
-+#ifdef CONFIG_MACH_APF27_FPGA
-+static int fpga_pins[] = {
-+ (APF27_FPGA_INT_PIN | GPIO_IN | GPIO_GPIO),
-+};
-+
-+static int apf27_fpga_irq_init(struct platform_device *pdev)
-+{
-+ int res;
-+
-+ res = mxc_gpio_setup_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins), "FPGA");
-+ if (!res)
-+ set_irq_type(APF27_FPGA_IRQ, IRQ_TYPE_EDGE_RISING);
-+
-+ return res;
-+}
-+
-+static void apf27_fpga_irq_exit(struct platform_device *pdev)
-+{
-+ mxc_gpio_release_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins));
-+}
-+
-+struct fpga_irq_mng_platform_data apf27_fpga_irq = {
-+ .init = apf27_fpga_irq_init,
-+ .exit = apf27_fpga_irq_exit,
-+};
-+
-+struct platform_device apf27_ocore_irq_mng_device = {
-+ .name = "ocore_irq_mng",
-+ .id = 0,
-+};
-+
-+static struct map_desc apf27_fpga_io_desc[] __initdata = {
-+ {
-+ .virtual = CS5_BASE_ADDR_VIRT,
-+ .pfn = __phys_to_pfn(MX27_CS5_BASE_ADDR),
-+ .length = CS5_SIZE,
-+ .type = MT_DEVICE,
-+ },
-+};
-+#endif /* CONFIG_MACH_APF27_FPGA */
-+
+static void __init apf27_init(void)
+{
+ int ret;
@@ -707,10 +661,6 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
+
+ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+
-+#ifdef CONFIG_MACH_APF27_FPGA
-+ mxc_register_device(&apf27_ocore_irq_mng_device, &apf27_fpga_irq);
-+#endif
-+
+ printk("i.MX27 chip revision: %d\n", mx27_revision() );
+#ifdef CONFIG_MACH_APF27_HAS_BASEBOARD
+ apf27_baseboard_init();
@@ -729,9 +679,6 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
+void __init apf27_map_io(void)
+{
+ mx27_map_io();
-+#ifdef CONFIG_MACH_APF27_FPGA
-+ iotable_init(apf27_fpga_io_desc, ARRAY_SIZE(apf27_fpga_io_desc));
-+#endif
+}
+
+MACHINE_START(APF27, "Armadeus APF27")
@@ -745,8 +692,8 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c 2011-05-10 14:05:29.000000000 +0200
-@@ -0,0 +1,938 @@
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c 2011-05-18 12:18:06.000000000 +0200
+@@ -0,0 +1,935 @@
+ /*
+ * apf27-dev.c
+ * Support for AFP27 module's development baseboard
@@ -827,9 +774,6 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c
+#endif
+//#include <mach/board-apf27.h>
+#include <asm/mach/map.h>
-+#ifdef CONFIG_MACH_APF27_FPGA
-+#include <mach/fpga.h>
-+#endif
+
+#include "devices-imx27.h"
+//#include "crm_regs.h"
@@ -1688,7 +1632,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c 2011-05-10 14:05:29.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c 2011-05-17 16:54:22.000000000 +0200
@@ -0,0 +1,168 @@
+/*
+ * apf27-lcd.c
@@ -1861,7 +1805,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c 2011-05-10 14:05:29.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c 2011-05-17 16:54:22.000000000 +0200
@@ -0,0 +1,175 @@
+ /*
+ * apf27-dev-ext-apw.c
@@ -2041,7 +1985,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-03-23 21:04:47.000000000 +0100
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-10 14:18:07.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-18 12:20:17.000000000 +0200
@@ -83,6 +83,7 @@
case MACH_TYPE_MX21ADS:
case MACH_TYPE_PCA100:
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/282-apf27-armadeus-add_apf27_to_build_system.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/282-apf27-armadeus-add_apf27_to_build_system.patch
index c0d8790..ef92ed5 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/282-apf27-armadeus-add_apf27_to_build_system.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/282-apf27-armadeus-add_apf27_to_build_system.patch
@@ -1,8 +1,8 @@
-Index: linux-2.6.38-rc3/arch/arm/mach-imx/Kconfig
+Index: linux-2.6.38.1/arch/arm/mach-imx/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-imx/Kconfig 2011-04-04 14:51:50.000000000 +0200
-+++ linux-2.6.38-rc3/arch/arm/mach-imx/Kconfig 2011-04-04 14:54:28.000000000 +0200
-@@ -350,4 +350,122 @@
+--- linux-2.6.38.1.orig/arch/arm/mach-imx/Kconfig 2011-05-17 22:35:01.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/Kconfig 2011-05-18 12:18:42.000000000 +0200
+@@ -350,4 +350,116 @@
Include support for i-MXT (aka td60) platform. This
includes specific configurations for the module and its peripherals.
@@ -23,12 +23,6 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/Kconfig
+ Include support for APF27 platform. This includes specific
+ configurations for the module and its peripherals.
+
-+config MACH_APF27_FPGA
-+ bool "board has a FPGA"
-+ depends on MACH_APF27
-+ help
-+ Select this if your APF27 has an onboard FPGA.
-+
+config MACH_APF27_HAS_BASEBOARD
+ bool
+
@@ -125,10 +119,10 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/Kconfig
+ depends on MACH_APF27_DEV_EXT_WIRELESS_GPS
+
endif
-Index: linux-2.6.38-rc3/arch/arm/mach-imx/Makefile
+Index: linux-2.6.38.1/arch/arm/mach-imx/Makefile
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-imx/Makefile 2011-04-04 14:51:50.000000000 +0200
-+++ linux-2.6.38-rc3/arch/arm/mach-imx/Makefile 2011-04-04 14:53:56.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-imx/Makefile 2011-05-17 22:35:00.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/Makefile 2011-05-17 22:35:11.000000000 +0200
@@ -38,3 +38,7 @@
obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
index f709610..0e652b3 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h 2011-05-17 14:44:36.000000000 +0200
-@@ -0,0 +1,49 @@
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h 2011-05-17 22:14:29.000000000 +0200
+@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009-2011 ARMadeus Systems
+ *
@@ -37,6 +37,7 @@ Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h
+# define ARMADEUS_FPGA_IRQ APF51_FPGA_IRQ
+# define IRQ_FPGA_START (MXC_BOARD_IRQ_START + 64)
+#elif defined(CONFIG_MACH_APF27) /* */
++#include <mach/iomux-v1.h>
+# define APF27_FPGA_BASE_ADDR 0xd6000000
+# define ARMADEUS_FPGA_BASE_ADDR APF27_FPGA_BASE_ADDR
+# define APF27_FPGA_INT_PIN (GPIO_PORTF | 12)
diff --git a/target/linux/modules/fpga/dev_tools/loader/apf27-fpga-loader.c b/target/linux/modules/fpga/dev_tools/loader/apf27-fpga-loader.c
index 2c80a8e..6c77b2e 100644
--- a/target/linux/modules/fpga/dev_tools/loader/apf27-fpga-loader.c
+++ b/target/linux/modules/fpga/dev_tools/loader/apf27-fpga-loader.c
@@ -43,20 +43,31 @@
#define CFG_FPGA_SUSPEND (GPIO_PORTF | 10) /* FPGA done pin */
#define CFG_FPGA_RESET (GPIO_PORTF | 7) /* FPGA done pin */
+void *fpga_membase;
+
static int fpga_shared_pins[] = {
(CFG_FPGA_INIT | GPIO_IN | GPIO_PUEN | GPIO_GPIO),
};
-
/* Initialize GPIO port before download */
int apf27_fpga_pre(void)
{
int res = 0;
+ fpga_membase = ioremap(ARMADEUS_FPGA_BASE_ADDR, 16);
+ if (!fpga_membase) {
+ printk(KERN_ERR "ioremap failed\n");
+ return -ENOMEM;
+ }
+
/* initialize common gpio "shared" with other apps */
- res = mxc_gpio_setup_multiple_pins(fpga_shared_pins, ARRAY_SIZE(fpga_shared_pins), "FPGA_LOADER");
+ res =
+ mxc_gpio_setup_multiple_pins(fpga_shared_pins,
+ ARRAY_SIZE(fpga_shared_pins),
+ "FPGA_LOADER");
if (res) {
- printk("FPGA prog pins already reserved !!\n");
+ printk(KERN_ERR "FPGA prog pins already reserved !!\n");
+ iounmap(fpga_membase);
return res;
}
@@ -83,7 +94,7 @@ int apf27_fpga_pre(void)
/* make sure the reset pin is active due to DLL start up */
mxc_gpio_mode(CFG_FPGA_RESET | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
- gpio_set_value(CFG_FPGA_RESET,1);
+ gpio_set_value(CFG_FPGA_RESET, 1);
/* make sure the fpga is powered */
gpio_set_value(CFG_FPGA_PWR, 0);
@@ -106,7 +117,7 @@ int apf27_fpga_pgm(int assert)
*/
int apf27_fpga_clk(int assert_clk)
{
- gpio_set_value( CFG_FPGA_CLK, !assert_clk);
+ gpio_set_value(CFG_FPGA_CLK, !assert_clk);
return assert_clk;
}
@@ -149,9 +160,9 @@ int apf27_fpga_cs(int assert_cs)
return assert_cs;
}
-int apf27_fpga_wdata( unsigned char data )
+int apf27_fpga_wdata(unsigned char data)
{
- __raw_writew(data, ARMADEUS_FPGA_BASE_ADDR_VIRT);
+ __raw_writew(data, fpga_membase);
return data;
}
@@ -163,7 +174,9 @@ int apf27_fpga_busy(void)
int apf27_fpga_post(void)
{
- mxc_gpio_release_multiple_pins(fpga_shared_pins, ARRAY_SIZE(fpga_shared_pins));
+ iounmap(fpga_membase);
+ mxc_gpio_release_multiple_pins(fpga_shared_pins,
+ ARRAY_SIZE(fpga_shared_pins));
/* reconfigure bus ctrl signals */
mxc_gpio_mode(CFG_FPGA_RW | GPIO_PF | GPIO_PUEN);
mxc_gpio_mode(CFG_FPGA_CS | GPIO_PF | GPIO_PUEN);
@@ -172,7 +185,7 @@ int apf27_fpga_post(void)
gpio_set_value(CFG_FPGA_PRG, 1);
/* reset off */
gpio_set_value(CFG_FPGA_RESET, 0);
- mxc_gpio_mode(CFG_FPGA_RESET | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+ mxc_gpio_mode(CFG_FPGA_RESET | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
return 0;
}
@@ -205,14 +218,14 @@ Xilinx_Spartan3_Slave_Parallel_fns fpga_fns = {
struct fpga_desc apf27_fpga_desc = {
.family = Xilinx_Spartan,
.iface = slave_parallel,
- .iface_fns = (void *) &fpga_fns
+ .iface_fns = (void *)&fpga_fns
};
static struct platform_device fpga_device = {
- .name = "fpgaloader",
- .id = 0,
+ .name = "fpgaloader",
+ .id = 0,
.dev = {
- .platform_data = &apf27_fpga_desc,
+ .platform_data = &apf27_fpga_desc,
},
};
@@ -228,4 +241,3 @@ static int __init apf27_fpga_initialize(void)
}
device_initcall(apf27_fpga_initialize);
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
index d92eff1..9c4e44c 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
@@ -2,7 +2,7 @@
* Platform data for IRQ manager generic driver
*
* (c) Copyright 2011 The Armadeus Project - ARMadeus Systems
- * Author: Julien Bibessot <jul...@ar...>
+ * Author: Julien Boibessot <jul...@ar...>
*
* 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
@@ -68,15 +68,31 @@ static struct platform_device irq_mng0_device = {
.resource = irq_mng0_resources,
};
+#ifdef CONFIG_MACH_APF27
+static int fpga_pins[] = {
+ (APF27_FPGA_INT_PIN | GPIO_IN | GPIO_GPIO),
+};
+#endif
+
static int __init board_irq_mng_init(void)
{
- set_irq_type(ARMADEUS_FPGA_IRQ, IRQF_TRIGGER_RISING);
+ int ret;
+
+#ifdef CONFIG_MACH_APF27
+ ret = mxc_gpio_setup_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins), "FPGA");
+ if (ret)
+ return -EINVAL;
+#endif
+ set_irq_type(ARMADEUS_FPGA_IRQ, IRQ_TYPE_EDGE_RISING);
return platform_device_register(&irq_mng0_device);
}
static void __exit board_irq_mng_exit(void)
{
platform_device_unregister(&irq_mng0_device);
+#ifdef CONFIG_MACH_APF27
+ mxc_gpio_release_multiple_pins(fpga_pins, ARRAY_SIZE(fpga_pins));
+#endif
}
module_init(board_irq_mng_init);
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
index 32da12b..13cf633 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
@@ -60,7 +60,7 @@ struct irq_mng {
struct resource *irq_res;
};
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36)
struct irq_mng global_mng;
#endif
@@ -78,6 +78,7 @@ static void imx_fpga_ack_irq(struct irq_data *data)
#else
static void imx_fpga_ack_irq(unsigned int irq)
{
+ struct irq_mng *mng = &global_mng;
#endif
int shadow;
@@ -94,7 +95,7 @@ static void imx_fpga_mask_irq(struct irq_data *data)
#else
static void imx_fpga_mask_irq(unsigned int irq)
{
- struct irq_mng *mng = global_mng;
+ struct irq_mng *mng = &global_mng;
#endif
int shadow;
@@ -112,7 +113,7 @@ static void imx_fpga_unmask_irq(struct irq_data *data)
#else
static void imx_fpga_unmask_irq(unsigned int irq)
{
- struct irq_mng *mng = global_mng;
+ struct irq_mng *mng = &global_mng;
#endif
int shadow;
@@ -222,7 +223,7 @@ static int __devinit ocore_irq_mng_probe(struct platform_device *pdev)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
mng = kmalloc(sizeof(struct irq_mng), GFP_KERNEL);
#else
- mng = global_mng;
+ mng = &global_mng;
#endif
if (!mng) {
ret = -ENOMEM;
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-17 14:29:32
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 60f9b13b7a8ad23549c55144f7a16f8ee0d048fc (commit)
via b9f019f47417f915230226c4ad4a4606a66f48b7 (commit)
via 544d483755e164c9b24a5a370c33b462b9824457 (commit)
via 3bfc0e7cfeb17d33d4b319ecdb841b4cf828bb19 (commit)
via 2a70384286bc5cc4e8fa6a4a4618a63cd5e829aa (commit)
via b4722b58fd8fdcf59b9ccb9437ac21212d7bbe68 (commit)
via 5abdd80cc27c5e6ab29f608ac4fa357facefa093 (commit)
via 9e8b08245713ad347697cc069e28f6d093ccd1e8 (commit)
via f0a73278649331e4cbe6da6ee711d45c43aff0b4 (commit)
from 38d9b8c222f030543a7d5ef727005fc7cb45981a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 60f9b13b7a8ad23549c55144f7a16f8ee0d048fc
Merge: b9f019f47417f915230226c4ad4a4606a66f48b7 38d9b8c222f030543a7d5ef727005fc7cb45981a
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 16:28:28 2011 +0200
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit b9f019f47417f915230226c4ad4a4606a66f48b7
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 16:27:45 2011 +0200
[TEST] Better APF51 support for LED test
commit 544d483755e164c9b24a5a370c33b462b9824457
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 16:24:32 2011 +0200
[LINUX] Adds release() method to wishbone_example/wb_button
commit 3bfc0e7cfeb17d33d4b319ecdb841b4cf828bb19
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 16:23:41 2011 +0200
Lindent
commit 2a70384286bc5cc4e8fa6a4a4618a63cd5e829aa
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 16:21:36 2011 +0200
[LINUX] APF51: makes wishbone irq_manager supported by APF51
commit b4722b58fd8fdcf59b9ccb9437ac21212d7bbe68
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 13:31:50 2011 +0200
[LINUX] APF51: add supported wishbone drivers in default config
commit 5abdd80cc27c5e6ab29f608ac4fa357facefa093
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 17 09:58:10 2011 +0200
[LINUX] Add platform data driver for twin UART IP (APF51Dev)
commit 9e8b08245713ad347697cc069e28f6d093ccd1e8
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 16 17:52:21 2011 +0200
[LINUX] Cleanup wishbone_example/wb_led and make it run on APF51
commit f0a73278649331e4cbe6da6ee711d45c43aff0b4
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 16 15:13:30 2011 +0200
[LINUX] Cleanup wishbone_example/wb_irq_mngr, make it run on new kernel/APF51 and divide it into board specific and generic part
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 12 +-
.../322-apf27-armadeus-add_mach_fpga_h.patch | 46 ++--
.../2.6.38/400-armadeus-add_apf51_module.patch | 20 +-
.../wishbone_example/wb_button/board_buttons.c | 9 +-
.../fpga/wishbone_example/wb_button/gbutton.c | 77 +++---
.../fpga/wishbone_example/wb_irq_mngr/Makefile | 2 +-
.../wishbone_example/wb_irq_mngr/board_irq_mng.c | 87 +++++++
.../fpga/wishbone_example/wb_irq_mngr/irq_mng.h} | 26 +--
.../fpga/wishbone_example/wb_irq_mngr/main.c | 257 ++++++++++++--------
.../fpga/wishbone_example/wb_irq_mngr/test.c | 8 +-
.../fpga/wishbone_example/wb_led/board_leds.c | 39 ++--
.../modules/fpga/wishbone_example/wb_led/g_led.c | 217 ++++++++---------
.../modules/fpga/wishbone_example/wb_led/led.h | 41 +---
.../linux/modules/fpga/wishbone_twin_uart/16750.c | 138 +++++++++++
.../fpga/{POD/void => wishbone_twin_uart}/Makefile | 14 +-
.../linux/modules/fpga/wishbone_twin_uart/README | 8 +
target/test/test_fpga.sh | 16 +-
17 files changed, 641 insertions(+), 376 deletions(-)
create mode 100644 target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
copy target/linux/{debug/imxregs/definitions.h => modules/fpga/wishbone_example/wb_irq_mngr/irq_mng.h} (62%)
create mode 100644 target/linux/modules/fpga/wishbone_twin_uart/16750.c
copy target/linux/modules/fpga/{POD/void => wishbone_twin_uart}/Makefile (54%)
mode change 100755 => 100644
create mode 100644 target/linux/modules/fpga/wishbone_twin_uart/README
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index 17ae00d..0fbd4d9 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Thu May 5 10:50:28 2011
+# Thu May 12 11:42:55 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1079,7 +1079,10 @@ CONFIG_DEVKMEM=y
#
# Serial drivers
#
-# CONFIG_SERIAL_8250 is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
#
# Non-8250 serial port support
@@ -1724,7 +1727,10 @@ CONFIG_ARMADEUS_FPGA_LOADER_DRIVER=m
#
# CONFIG_ARMADEUS_I2C_OCORE_IRQMNG is not set
# CONFIG_ARMADEUS_PS2KBD_DRIVER is not set
-# CONFIG_ARMADEUS_WISHBONE_EXAMPLE_DRIVERS is not set
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_DRIVERS=y
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_BUTTON_DRIVER=m
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_LED_DRIVER=m
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_IRQ_MNGR_DRIVER=m
# CONFIG_POD_DRIVERS is not set
#
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
index b6f4507..f709610 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/322-apf27-armadeus-add_mach_fpga_h.patch
@@ -1,10 +1,10 @@
-Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/fpga.h
+Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.36/arch/arm/plat-mxc/include/mach/fpga.h 2010-11-25 20:23:44.000000000 +0100
-@@ -0,0 +1,43 @@
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/fpga.h 2011-05-17 14:44:36.000000000 +0200
+@@ -0,0 +1,49 @@
+/*
-+ * Copyright (C) 2009 Armadeus Systems
++ * Copyright (C) 2009-2011 ARMadeus Systems
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
@@ -24,25 +24,31 @@ Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/fpga.h
+#ifndef __ASM_ARCH_ARMADEUS_FPGA_H__
+#define __ASM_ARCH_ARMADEUS_FPGA_H__
+
++#ifndef CONFIG_MACH_APF9328
++# include <mach/irqs.h>
++# include <mach/gpio.h>
++#endif
+
-+#ifdef CONFIG_MACH_APF27
-+#include <mach/board-apf27.h> /* @ are here */
-+#include <mach/irqs.h>
++#if defined(CONFIG_MACH_APF51) /* */
++# define APF51_FPGA_BASE_ADDR 0xb8000000
++# define ARMADEUS_FPGA_BASE_ADDR APF51_FPGA_BASE_ADDR
++# define APF51_FPGA_INT_PIN (IMX_GPIO_NR(4, 11)) /* INITB */
++# define APF51_FPGA_IRQ (gpio_to_irq(APF51_FPGA_INT_PIN))
++# define ARMADEUS_FPGA_IRQ APF51_FPGA_IRQ
++# define IRQ_FPGA_START (MXC_BOARD_IRQ_START + 64)
++#elif defined(CONFIG_MACH_APF27) /* */
++# define APF27_FPGA_BASE_ADDR 0xd6000000
++# define ARMADEUS_FPGA_BASE_ADDR APF27_FPGA_BASE_ADDR
++# define APF27_FPGA_INT_PIN (GPIO_PORTF | 12)
++# define APF27_FPGA_IRQ (IRQ_GPIOF(12))
++# define ARMADEUS_FPGA_IRQ APF27_FPGA_IRQ
++# define IRQ_FPGA_START MXC_BOARD_IRQ_START
++#elif defined(CONFIG_MACH_APF9328) /* */
++# define APF9328_FPGA_BASE_ADDR 0x12000000
++# define ARMADEUS_FPGA_BASE_ADDR APF9328_FPGA_BASE_ADDR
+#else
-+/* To complete when MX1 platform merged */
++# error "Unsupported platform"
+#endif
-+#include <linux/platform_device.h>
+
-+/* FPGA interrupts number */
-+#ifdef CONFIG_MACH_APF27
-+#define IRQ_FPGA_START (MXC_BOARD_IRQ_START)
-+#endif
+#define IRQ_FPGA(x) (IRQ_FPGA_START + x)
-+#define NR_IRQS_FPGA (MXC_BOARD_IRQS)
-+
-+struct fpga_irq_mng_platform_data {
-+ int (*init)(struct platform_device*);
-+ void (*exit)(struct platform_device*);
-+};
-+
+#endif /* __ASM_ARCH_ARMADEUS_FPGA_H__ */
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index d53e66f..3f576d0 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,7 +1,7 @@
Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-03 16:22:02.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-03 16:49:55.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-17 14:45:14.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-17 15:22:10.000000000 +0200
@@ -162,4 +162,16 @@
Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals.
@@ -21,8 +21,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-03-23 21:04:47.000000000 +0100
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-03 16:49:55.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-05-17 14:44:47.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-17 15:22:10.000000000 +0200
@@ -7,6 +7,7 @@
obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
@@ -34,7 +34,7 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-05-03 16:50:51.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-05-17 14:45:17.000000000 +0200
@@ -0,0 +1,495 @@
+/*
+ * Support for APF51 System On Module
@@ -533,8 +533,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-03 16:22:04.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-03 16:22:05.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-17 14:45:16.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-17 14:45:17.000000000 +0200
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -555,14 +555,14 @@ Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
}
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-03 16:22:05.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-03 16:22:05.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-17 14:45:16.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-17 15:23:51.000000000 +0200
@@ -53,6 +53,8 @@
#define MXC_BOARD_IRQS 80
#elif defined CONFIG_MACH_APF27
#define MXC_BOARD_IRQS 32
+#elif defined CONFIG_MACH_APF51
-+#define MXC_BOARD_IRQS 70 /* WM8311 eats a lot of them */
++#define MXC_BOARD_IRQS 80 /* WM8311 needs 64 of them and FPGA 16 */
#else
#define MXC_BOARD_IRQS 16
#endif
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c b/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
index d530265..f662cf1 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
@@ -23,6 +23,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+
#include <mach/hardware.h>
#ifndef CONFIG_MACH_APF9328 /* To remove when MX1 platform is merged */
#include <mach/fpga.h>
@@ -52,11 +53,17 @@ static struct plat_button_port plat_button0_data = {
.idoffset = 0x00 * (16 / 8)
};
+void plat_button_release(struct device *dev)
+{
+ dev_dbg(dev, "released\n");
+}
+
static struct platform_device plat_button0_device = {
.name = "button",
.id = 0,
.dev = {
- .platform_data = &plat_button0_data
+ .release = plat_button_release,
+ .platform_data = &plat_button0_data
},
.num_resources = ARRAY_SIZE(button0_resources),
.resource = button0_resources,
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
index a2ba158..2eb84d0 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
@@ -38,20 +38,19 @@
#include "button.h"
-
struct button_dev {
- char *name; /* name of the instance */
- struct cdev cdev; /* char device structure */
- struct semaphore sem; /* mutex */
- void * membase; /* base address for instance */
- dev_t devno; /* to store Major and minor numbers */
- u8 read_in_wait; /* user is waiting for value to read */
+ char *name; /* name of the instance */
+ struct cdev cdev; /* char device structure */
+ struct semaphore sem; /* mutex */
+ void *membase; /* base address for instance */
+ dev_t devno; /* to store Major and minor numbers */
+ u8 read_in_wait; /* user is waiting for value to read */
struct resource *mem_res;
struct resource *irq_res;
};
-ssize_t button_read(struct file *fildes, char __user *buff,
- size_t count, loff_t *offp)
+ssize_t button_read(struct file *fildes, char __user * buff,
+ size_t count, loff_t * offp)
{
struct button_dev *ldev = fildes->private_data;
u16 data = 0;
@@ -59,7 +58,7 @@ ssize_t button_read(struct file *fildes, char __user *buff,
ldev->read_in_wait = 1;
- if (*offp + count >= 1) /* Only one word can be read */
+ if (*offp + count >= 1) /* Only one word can be read */
count = 1 - *offp;
if ((retval = down_interruptible(&ldev->sem)) < 0) {
@@ -67,7 +66,8 @@ ssize_t button_read(struct file *fildes, char __user *buff,
}
data = readw(ldev->membase + BUTTON_REG_OFFSET);
- pr_debug("Read %d at 0x%x\n", data, (unsigned int)ldev->membase + BUTTON_REG_OFFSET);
+ pr_debug("Read %d at 0x%x\n", data,
+ (unsigned int)ldev->membase + BUTTON_REG_OFFSET);
/* return data for user */
if (copy_to_user(buff, &data, 2)) {
@@ -87,7 +87,8 @@ out:
int button_open(struct inode *inode, struct file *filp)
{
/* Allocate and fill any data structure to be put in filp->private_data */
- filp->private_data = container_of(inode->i_cdev, struct button_dev, cdev);
+ filp->private_data =
+ container_of(inode->i_cdev, struct button_dev, cdev);
return 0;
}
@@ -104,8 +105,8 @@ int button_release(struct inode *inode, struct file *filp)
static struct file_operations button_fops = {
.owner = THIS_MODULE,
- .read = button_read,
- .open = button_open,
+ .read = button_read,
+ .open = button_open,
.release = button_release,
};
@@ -150,7 +151,9 @@ static int button_probe(struct platform_device *pdev)
return -EINVAL;
}
- mem_res = request_mem_region(mem_res->start, resource_size(mem_res), pdev->name);
+ mem_res =
+ request_mem_region(mem_res->start, resource_size(mem_res),
+ pdev->name);
if (!mem_res) {
dev_err(&pdev->dev, "iomem already in use\n");
return -EBUSY;
@@ -177,15 +180,15 @@ static int button_probe(struct platform_device *pdev)
if (ip_id != pdata->idnum) {
ret = -ENODEV;
dev_warn(&pdev->dev, "For %s id:%d doesn't match "
- "with id read %d,\n is device present ?\n",
- pdata->name, pdata->idnum, ip_id);
+ "with id read %d,\n is device present ?\n",
+ pdata->name, pdata->idnum, ip_id);
goto out_iounmap;
}
pdata->sdev = sdev;
- sdev->name = (char *)kmalloc((1+strlen(pdata->name))*sizeof(char),
- GFP_KERNEL);
+ sdev->name = (char *)kmalloc((1 + strlen(pdata->name)) * sizeof(char),
+ GFP_KERNEL);
if (sdev->name == NULL) {
dev_err(&pdev->dev, "Kmalloc name space error\n");
goto out_iounmap;
@@ -203,13 +206,11 @@ static int button_probe(struct platform_device *pdev)
ret = alloc_chrdev_region(&(sdev->devno), button_minor, 1, pdata->name);
if (ret < 0) {
dev_warn(&pdev->dev, "%s: can't get major %d\n",
- pdata->name, button_major);
+ pdata->name, button_major);
goto out_name_free;
}
dev_info(&pdev->dev, "%s: MAJOR: %d MINOR: %d\n",
- pdata->name,
- MAJOR(sdev->devno),
- MINOR(sdev->devno));
+ pdata->name, MAJOR(sdev->devno), MINOR(sdev->devno));
/* initiate mutex locked */
sdev->read_in_wait = 0;
@@ -218,10 +219,10 @@ static int button_probe(struct platform_device *pdev)
/* Init the cdev structure */
cdev_init(&sdev->cdev, &button_fops);
sdev->cdev.owner = THIS_MODULE;
- sdev->cdev.ops = &button_fops;
+ sdev->cdev.ops = &button_fops;
pr_debug("%s: Add the device to the kernel, "
- "connecting cdev to major/minor number \n", pdata->name);
+ "connecting cdev to major/minor number \n", pdata->name);
ret = cdev_add(&sdev->cdev, sdev->devno, 1);
if (ret < 0) {
dev_warn(&pdev->dev, "%s: can't add cdev\n", pdata->name);
@@ -230,16 +231,14 @@ static int button_probe(struct platform_device *pdev)
/* irq registering */
ret = request_irq(sdev->irq_res->start,
- button_interrupt,
- IRQF_SAMPLE_RANDOM,
- sdev->name,
- sdev);
+ button_interrupt,
+ IRQF_SAMPLE_RANDOM, sdev->name, sdev);
if (ret < 0) {
printk(KERN_ERR "Can't register irq %d\n",
- sdev->irq_res->start);
+ sdev->irq_res->start);
goto request_irq_error;
}
-
+
/* OK driver ready ! */
printk(KERN_INFO "%s loaded\n", pdata->name);
return 0;
@@ -285,14 +284,13 @@ static int __devexit button_remove(struct platform_device *pdev)
return 0;
}
-static struct platform_driver plat_button_driver =
-{
- .probe = button_probe,
- .remove = __devexit_p(button_remove),
- .driver = {
- .name = "button",
- .owner = THIS_MODULE,
- },
+static struct platform_driver plat_button_driver = {
+ .probe = button_probe,
+ .remove = __devexit_p(button_remove),
+ .driver = {
+ .name = "button",
+ .owner = THIS_MODULE,
+ },
};
static int __init button_init(void)
@@ -320,4 +318,3 @@ module_exit(button_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
MODULE_DESCRIPTION("Wishbone button IP generic driver");
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/Makefile b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/Makefile
index e575612..db8e79c 100755
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/Makefile
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/Makefile
@@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
# Part executed when called from kernel build system:
-obj-$(CONFIG_ARMADEUS_WISHBONE_EXAMPLE_IRQ_MNGR_DRIVER) += irq_ocore.o test.o
+obj-$(CONFIG_ARMADEUS_WISHBONE_EXAMPLE_IRQ_MNGR_DRIVER) += irq_ocore.o board_irq_mng.o test.o
irq_ocore-objs := main.o
else
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
new file mode 100644
index 0000000..d92eff1
--- /dev/null
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/board_irq_mng.c
@@ -0,0 +1,87 @@
+/*
+ * Platform data for IRQ manager generic driver
+ *
+ * (c) Copyright 2011 The Armadeus Project - ARMadeus Systems
+ * Author: Julien Bibessot <jul...@ar...>
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+
+#include <mach/hardware.h>
+#ifndef CONFIG_MACH_APF9328 /* To remove when MX1 platform is merged */
+#include <mach/fpga.h>
+#endif
+
+#include "irq_mng.h"
+
+static struct resource irq_mng0_resources[] = {
+ [0] = {
+ .start = ARMADEUS_FPGA_BASE_ADDR + 0x0,
+ .end = ARMADEUS_FPGA_BASE_ADDR + 0x0 + 0x8,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = ARMADEUS_FPGA_IRQ,
+ .end = ARMADEUS_FPGA_IRQ,
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+static struct ocore_irq_mng_pdata irq_mng0_data = {
+ .num = 0,
+ .idnum = 0x01,
+ .idoffset = 0x06,
+};
+
+void irq_mng0_release(struct device *dev)
+{
+ dev_dbg(dev, "released\n");
+}
+
+static struct platform_device irq_mng0_device = {
+ .name = "ocore_irq_mng",
+ .id = 0,
+ .dev = {
+ .release = irq_mng0_release,
+ .platform_data = &irq_mng0_data
+ },
+ .num_resources = ARRAY_SIZE(irq_mng0_resources),
+ .resource = irq_mng0_resources,
+};
+
+static int __init board_irq_mng_init(void)
+{
+ set_irq_type(ARMADEUS_FPGA_IRQ, IRQF_TRIGGER_RISING);
+ return platform_device_register(&irq_mng0_device);
+}
+
+static void __exit board_irq_mng_exit(void)
+{
+ platform_device_unregister(&irq_mng0_device);
+}
+
+module_init(board_irq_mng_init);
+module_exit(board_irq_mng_exit);
+
+MODULE_AUTHOR("Julien Boibessot <jul...@ar...>");
+MODULE_DESCRIPTION("Platform data for IRQ manager IP driver");
+MODULE_LICENSE("GPL");
diff --git a/target/linux/debug/imxregs/definitions.h b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/irq_mng.h
similarity index 62%
copy from target/linux/debug/imxregs/definitions.h
copy to target/linux/modules/fpga/wishbone_example/wb_irq_mngr/irq_mng.h
index ee71db3..2632c46 100644
--- a/target/linux/debug/imxregs/definitions.h
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/irq_mng.h
@@ -1,8 +1,8 @@
/*
- * definitions.h - imxregs common definitions
+ * Platform data for IRQ manager generic driver
*
- * Copyright (C) 2008 armadeus systems
- * Author: Julien Boibessot
+ * (c) Copyright 2011 The Armadeus Project - ARMadeus Systems
+ * Author: Julien Bibessot <jul...@ar...>
*
* 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
@@ -17,20 +17,16 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
*/
-typedef unsigned int u32;
+#ifndef __IRQ_MNG_H__
+#define __IRQ_MNG_H__
-struct reg_info {
- char *name;
- u32 addr;
- int shift;
- u32 mask;
- char type;
- char *desc;
+struct ocore_irq_mng_pdata {
+ int num; /* instance number */
+ int idnum; /* identity number */
+ int idoffset; /* identity register relative address */
+ struct irq_mng *mng;
};
-// Size of mmapping:
-#define MAP_SIZE 4096
-#define MAP_MASK ( MAP_SIZE - 1 )
+#endif /* __IRQ_MNG_H__ */
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
index 94c8f56..32da12b 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/main.c
@@ -1,8 +1,7 @@
/*
- * Driver for the IRQ manager (OpenCore/Wishbone based) loaded in the FPGA of
- * the Armadeus boards.
+ * Driver for the IRQ manager (OpenCore/Wishbone based) IP
*
- * (C) Copyright 2008 Armadeus Systems
+ * (C) Copyright 2008-2011 ARMadeus Systems
* Author: Julien Boibessot <jul...@ar...>
*
* Inspired of linux/arch/arm/mach-imx/irq.c
@@ -23,7 +22,7 @@
*
*/
-/* #define DEBUG */
+/*#define DEBUG*/
#include <linux/module.h>
#include <linux/init.h>
@@ -32,201 +31,262 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/version.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)
+#include <linux/slab.h> /* kmalloc */
+#endif
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <asm/irq.h>
#include <asm/io.h> /* readb() & Co */
-
#include <asm/mach/irq.h>
-#ifdef CONFIG_MACH_APF27
-#include <mach/fpga.h> /* To remove when MX1 platform merged */
-#define VA_GPIO_BASE MX27_GPIO_BASE_ADDR
-#else
-#define VA_GPIO_BASE IO_ADDRESS(IMX_GPIO_BASE)
-#define MXC_ISR(x) (0x34 + ((x) << 8))
-struct fpga_irq_mng_platform_data { /* To remove when MX1 platform merged */
- int (*init)(struct platform_device*);
- void (*exit)(struct platform_device*);
-};
+
+#include "irq_mng.h"
+
+#ifndef CONFIG_MACH_APF9328
+# include <mach/fpga.h> /* To remove when MX1 platform is merged */
#endif
-#define IRQ_MNGR_BASE (0x0)
-#define ID (1)
-#define ID_OFFSET (0x02 *(16/8))
+#define ID_OFFSET (0x02 *(16/8))
+#define NB_IT 16
+#define FPGA_IMR 0x00 /* Interrupt Mask Register relative @*/
+#define FPGA_ISR 0x02 /* Interrupt Status Register relative @*/
-#define NB_IT (16)
+#define DRIVER_NAME "ocore_irq_mng"
-#define FPGA_IMR (ARMADEUS_FPGA_BASE_ADDR_VIRT + IRQ_MNGR_BASE + 0x00) /* Interrupt Mask Register */
-#define FPGA_ISR (ARMADEUS_FPGA_BASE_ADDR_VIRT + IRQ_MNGR_BASE + 0x02) /* Interrupt Status Register */
+struct irq_mng {
+ void *membase;
+ struct resource *mem_res;
+ struct resource *irq_res;
+};
-#define DRIVER_NAME "ocore_irq_mng"
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+struct irq_mng global_mng;
+#endif
-static int
-imx_fpga_irq_type(unsigned int _irq, unsigned int type)
+static int imx_fpga_irq_type(unsigned int _irq, unsigned int type)
{
return 0;
}
-static void
-imx_fpga_ack_irq(unsigned int irq)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+static void imx_fpga_ack_irq(struct irq_data *data)
+{
+ struct irq_mng *mng = irq_data_get_irq_chip_data(data);
+ unsigned int irq = data->irq;
+#else
+static void imx_fpga_ack_irq(unsigned int irq)
{
+#endif
int shadow;
shadow = 1 << ((irq - IRQ_FPGA_START) % NB_IT);
pr_debug("%s: irq %d ack:0x%x\n", __FUNCTION__, irq, shadow);
- writew(shadow, FPGA_ISR);
-
- /* if last IT, ack GPIO global IRQ */
- if (readw(FPGA_ISR) == 0) {
- __raw_writel(1 << (ARMADEUS_FPGA_IRQ & 0x1f),
- VA_GPIO_BASE + MXC_ISR(IRQ_TO_REG(ARMADEUS_FPGA_IRQ)));
- }
+ writew(shadow, mng->membase + FPGA_ISR);
}
-static void
-imx_fpga_mask_irq(unsigned int irq)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+static void imx_fpga_mask_irq(struct irq_data *data)
{
+ struct irq_mng *mng = irq_data_get_irq_chip_data(data);
+ unsigned int irq = data->irq;
+#else
+static void imx_fpga_mask_irq(unsigned int irq)
+{
+ struct irq_mng *mng = global_mng;
+#endif
int shadow;
- shadow = readw(FPGA_IMR);
+ shadow = readw(mng->membase + FPGA_IMR);
shadow &= ~( 1 << ((irq - IRQ_FPGA_START) % NB_IT));
pr_debug("%s: irq %d mask:0x%x\n", __FUNCTION__, irq, shadow);
- writew(shadow, FPGA_IMR);
+ writew(shadow, mng->membase + FPGA_IMR);
}
-static void
-imx_fpga_unmask_irq(unsigned int irq)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+static void imx_fpga_unmask_irq(struct irq_data *data)
{
+ struct irq_mng *mng = irq_data_get_irq_chip_data(data);
+ unsigned int irq = data->irq;
+#else
+static void imx_fpga_unmask_irq(unsigned int irq)
+{
+ struct irq_mng *mng = global_mng;
+#endif
int shadow;
- shadow = readw(FPGA_IMR);
+ shadow = readw(mng->membase + FPGA_IMR);
shadow |= 1 << ((irq - IRQ_FPGA_START) % NB_IT);
pr_debug("%s: irq %d mask:0x%x\n", __FUNCTION__, irq, shadow);
- writew(shadow, FPGA_IMR);
+ writew(shadow, mng->membase + FPGA_IMR);
}
-static void
-imx_fpga_handler(unsigned int mask, unsigned int irq,
- struct irq_desc *desc)
+static irqreturn_t ocore_irq_mng_interrupt(int irq, void *data)
{
+ struct irq_mng *mng = data;
+ struct irq_desc *desc;
+ unsigned int mask;
+
+ mask = readw(mng->membase + FPGA_ISR);
+ irq = IRQ_FPGA_START;
+
pr_debug("%s: mask:0x%04x\n", __FUNCTION__, mask);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)
desc = irq_to_desc(irq);
#else
desc = irq_desc + irq;
#endif
+ /* handle irqs */
while (mask) {
if (mask & 1) {
- pr_debug("handling irq %d\n", irq);
+ pr_debug("handling irq %d 0x%08x\n", irq,
+ (unsigned int)desc);
desc_handle_irq(irq, desc);
}
irq++;
desc++;
mask >>= 1;
}
-}
-static void
-imx_fpga_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
-{
- unsigned int mask, irq;
-
- mask = readw(FPGA_ISR);
- irq = IRQ_FPGA_START;
- imx_fpga_handler(mask, irq, desc);
+ return IRQ_HANDLED;
}
static struct irq_chip imx_fpga_chip = {
- .name = "FPGA",
- .ack = imx_fpga_ack_irq,
- .mask = imx_fpga_mask_irq,
- .unmask = imx_fpga_unmask_irq,
- .set_type = imx_fpga_irq_type,
+ .name = "FPGA",
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+ .irq_ack = imx_fpga_ack_irq,
+ .irq_mask = imx_fpga_mask_irq,
+ .irq_unmask = imx_fpga_unmask_irq,
+#else
+ .ack = imx_fpga_ack_irq,
+ .mask = imx_fpga_mask_irq,
+ .unmask = imx_fpga_unmask_irq,
+#endif
+ .set_type = imx_fpga_irq_type,
};
-
#ifdef CONFIG_PM
static int ocore_irq_mng_suspend(struct platform_device *pdev, pm_message_t state)
{
- struct fpga_irq_mng_platform_data *pdata = pdev->dev.platform_data;
-
dev_dbg(&pdev->dev, "suspended\n");
- if (pdata->exit)
- pdata->exit(pdev);
return 0;
}
static int ocore_irq_mng_resume(struct platform_device *pdev)
{
- struct fpga_irq_mng_platform_data *pdata = pdev->dev.platform_data;
-
dev_dbg(&pdev->dev, "resumed\n");
- if (pdata->init)
- pdata->init(pdev);
return 0;
}
#else
-
# define ocore_irq_mng_suspend NULL
# define ocore_irq_mng_resume NULL
-
#endif /* CONFIG_PM */
static int __devinit ocore_irq_mng_probe(struct platform_device *pdev)
{
+ struct ocore_irq_mng_pdata *pdata = pdev->dev.platform_data;
unsigned int irq;
- u16 data;
+ u16 id;
int ret = 0;
- struct fpga_irq_mng_platform_data *pdata;
+ struct resource *mem_res;
+ struct resource *irq_res;
+ struct irq_mng *mng;
- pr_debug("Initializing FPGA IRQs\n");
+ if (!pdata) {
+ dev_err(&pdev->dev, "Platform data required !\n");
+ return -ENODEV;
+ }
- /* check if ID is correct */
- data = ioread16(ARMADEUS_FPGA_BASE_ADDR_VIRT + IRQ_MNGR_BASE + ID_OFFSET);
- if (data != ID) {
- printk(KERN_WARNING "For irq_mngr id:%d doesn't match with id"
- "read %d,\n is device present ?\n", ID, data);
- return -ENODEV;
+ /* get resources */
+ mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "can't find mem resource\n");
+ return -EINVAL;
+ }
+ irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!irq_res) {
+ dev_err(&pdev->dev, "can't find irq resource\n");
+ return -EINVAL;
}
- pdata = pdev->dev.platform_data;
- if (!pdata) {
- dev_err(&pdev->dev,"No platform_data available\n");
- return -ENOMEM;
+ mem_res = request_mem_region(mem_res->start, resource_size(mem_res), pdev->name);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "iomem already in use\n");
+ return -EBUSY;
}
- /* Mask all interrupts initially */
- writew(0, FPGA_IMR);
+ /* allocate memory for private structure */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)
+ mng = kmalloc(sizeof(struct irq_mng), GFP_KERNEL);
+#else
+ mng = global_mng;
+#endif
+ if (!mng) {
+ ret = -ENOMEM;
+ goto out_release_mem;
+ }
- if (pdata->init) {
- ret = pdata->init(pdev);
- if (ret)
- goto failed_platform_init;
+ mng->membase = ioremap(mem_res->start, resource_size(mem_res));
+ if (!mng->membase) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto out_dev_free;
}
+ mng->mem_res = mem_res;
+ mng->irq_res = irq_res;
+
+ /* check if ID is correct */
+ id = readw(mng->membase + ID_OFFSET);
+ if (id != pdata->idnum) {
+ printk(KERN_WARNING "For irq_mngr id:%d doesn't match with id"
+ "read %d,\n is device present ?\n", pdata->idnum, id);
+ ret = -ENODEV;
+ goto out_iounmap;
+ }
+
+ /* Mask all interrupts initially */
+ writew(0, mng->membase + FPGA_IMR);
for (irq = IRQ_FPGA(0); irq < IRQ_FPGA(NB_IT); irq++) {
- pr_debug("IRQ %d\n", irq);
+ printk("IRQ %d\n", irq);
+ set_irq_chip_data(irq, mng);
set_irq_chip_and_handler(irq, &imx_fpga_chip, handle_edge_irq);
set_irq_flags(irq, IRQF_VALID);
- /* clear pending interrrupts */
- imx_fpga_ack_irq(irq);
}
- set_irq_chained_handler(ARMADEUS_FPGA_IRQ, imx_fpga_demux_handler);
+ /* clear pending interrupts */
+ writew(0xffff, mng->membase + FPGA_ISR);
+
+ ret = request_irq(mng->irq_res->start, ocore_irq_mng_interrupt,
+ IRQF_SAMPLE_RANDOM, "ocore_irq_mng", mng);
+
+ if (ret < 0) {
+ printk(KERN_ERR "Can't register irq %d\n",
+ mng->irq_res->start);
+ goto request_irq_error;
+ }
- pr_debug("FPGA IRQs initialized (Parent=%d)\n", ARMADEUS_FPGA_IRQ);
+ pr_debug("FPGA IRQs initialized (Parent=%d)\n", mng->irq_res->start);
return 0;
-failed_platform_init:
+request_irq_error:
+out_iounmap:
+ iounmap(mng->membase);
+out_dev_free:
+ kfree(mng);
+out_release_mem:
+ release_mem_region(mem_res->start, resource_size(mem_res));
+
return ret;
}
static int __devexit ocore_irq_mng_remove(struct platform_device *pdev)
{
+ struct ocore_irq_mng_pdata *pdata = pdev->dev.platform_data;
+ struct irq_mng *mng = (*pdata).mng;
unsigned int irq;
for (irq = IRQ_FPGA(0); irq < IRQ_FPGA(NB_IT); irq++) {
@@ -234,9 +294,10 @@ static int __devexit ocore_irq_mng_remove(struct platform_device *pdev)
set_irq_handler(irq,NULL);
set_irq_flags(irq, 0);
}
- set_irq_chained_handler(ARMADEUS_FPGA_IRQ, NULL);
-
- pr_debug("%s\n", __FUNCTION__);
+ free_irq(mng->irq_res->start, mng);
+ release_mem_region(mng->mem_res->start, resource_size(mng->mem_res));
+ iounmap(mng->membase);
+ kfree(mng);
return 0;
}
diff --git a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/test.c b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/test.c
index 430e112..d8214b3 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/test.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_irq_mngr/test.c
@@ -1,7 +1,7 @@
/*
* Driver to test OpenCore IRQ manager driver
*
- * Copyright (C) 2008 Armadeus Systems
+ * Copyright (C) 2008-2011 ARMadeus Systems
* Author: Julien Boibessot <jul...@ar...>
*
* This program is free software; you can redistribute it and/or modify
@@ -20,15 +20,14 @@
*
*/
-
#include <linux/version.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <asm/irq.h>
-#ifdef CONFIG_MACH_APF27
-#include <mach/fpga.h> /* To remove when MX1 platform merged*/
+#ifndef CONFIG_MACH_APF9328
+#include <mach/fpga.h> /* To remove when MX1 platform is merged*/
#endif
@@ -74,7 +73,6 @@ static void __exit irq_mng_test_exit(void)
free_irq(interrupt, 0); /* still a bug here ! */
}
-
module_init(irq_mng_test_init);
module_exit(irq_mng_test_exit);
diff --git a/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c b/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
index b37b47e..6485fd4 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/board_leds.c
@@ -1,7 +1,7 @@
/*
- * Specific led driver for generic led driver
+ * Platform data for generic LED IP driver
*
- * (c) Copyright 2008 Armadeus project
+ * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
*
* This program is free software; you can redistribute it and/or modify
@@ -24,36 +24,43 @@
#include <linux/module.h>
#include <linux/platform_device.h>
-#ifdef CONFIG_MACH_APF27 /* to be removed when MX1 platform merged */
+#ifndef CONFIG_MACH_APF9328 /* to be removed when MX1 platform is merged */
#include <mach/fpga.h>
#endif
+
#include "led.h"
+static struct resource led0_resources[] = {
+ [0] = {
+ .start = ARMADEUS_FPGA_BASE_ADDR + 0x8,
+ .end = ARMADEUS_FPGA_BASE_ADDR + 0x8 + 0x4,
+ .flags = IORESOURCE_MEM,
+ },
+};
static struct plat_led_port plat_led0_data = {
- .name = "LED0",
- .num = 0,
- .membase = (void *)(ARMADEUS_FPGA_BASE_ADDR_VIRT + 0x8),
- .idnum = 2,
- .idoffset = 0x01 * (16 / 8),
+ .name = "LED0",
+ .num = 0,
+ .idnum = 2,
+ .idoffset = 0x01 * (16 / 8),
};
-
void plat_led_release(struct device *dev)
{
dev_dbg(dev, "released\n");
}
static struct platform_device plat_led0_device = {
- .name = "led",
- .id = 0,
- .dev = {
- .release = plat_led_release,
- .platform_data = &plat_led0_data
+ .name = "led",
+ .id = 0,
+ .dev = {
+ .release = plat_led_release,
+ .platform_data = &plat_led0_data
},
+ .num_resources = ARRAY_SIZE(led0_resources),
+ .resource = led0_resources,
};
-
static int __init sled_init(void)
{
return platform_device_register(&plat_led0_device);
@@ -61,7 +68,6 @@ static int __init sled_init(void)
static void __exit sled_exit(void)
{
- printk(KERN_WARNING "deleting board_leds\n");
platform_device_unregister(&plat_led0_device);
}
@@ -71,4 +77,3 @@ module_exit(sled_exit);
MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
MODULE_DESCRIPTION("Driver to blink some LEDs on FPGA");
MODULE_LICENSE("GPL");
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c b/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
index fcd83ca..ad81871 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/g_led.c
@@ -1,9 +1,8 @@
/*
- ***********************************************************************
+ * Generic driver for Wishbone LED IP
*
* (c) Copyright 2008 Armadeus project
* Fabien Marteau <fab...@ar...>
- * Generic driver for Wishbone led IP
*
* 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
@@ -18,14 +17,11 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
*/
#include <linux/version.h>
-/* form module/drivers */
#include <linux/init.h>
#include <linux/module.h>
-/* for file operations */
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/ioport.h> /* request_mem_region */
@@ -38,40 +34,18 @@
#include <asm/io.h> /* readw() writew() */
#include <mach/hardware.h>
-/* led */
#include "led.h"
-
-/* for debugging messages*/
-//#define LED_DEBUG
-
-#undef PDEBUG
-#ifdef LED_DEBUG
-# ifdef __KERNEL__
-/* for kernel spage */
-# define PDEBUG(fmt,args...) printk(KERN_DEBUG "LED : " fmt, ##args)
-# else
-/* for user space */
-# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
-# endif
-#else
-# define PDEBUG(fmt,args...) /* no debbuging message */
-#endif
-
-/*************************/
/* main device structure */
-/*************************/
struct led_dev {
char *name; /* the name of the instance */
int loaded_led_num;/* number of the led, depends on load order*/
struct cdev cdev;/* Char device structure */
void * membase; /* base address for instance */
dev_t devno; /* to store Major and minor numbers */
+ struct resource *mem_res;
};
-/******************************/
-/* to read write led register */
-/******************************/
ssize_t led_read(struct file *fildes, char __user *buff,
size_t count, loff_t *offp);
@@ -98,19 +72,19 @@ ssize_t led_read(struct file *fildes, char __user *buff,
struct led_dev *sdev = fildes->private_data;
u16 data=0;
- PDEBUG("Read value\n");
+ pr_debug("Read value\n");
if (*offp != 0) { /* offset must be 0 */
- PDEBUG("offset %d\n", (int)*offp);
+ pr_debug("offset %d\n", (int)*offp);
return 0;
}
- PDEBUG("count %d\n",count);
+ pr_debug("count %d\n", count);
if (count > 2) { /* 16bits max*/
count = 2;
}
- data = ioread16(sdev->membase+LED_REG_OFFSET);
- PDEBUG("Read %d at %x\n", data, (int)(sdev->membase+LED_REG_OFFSET));
+ data = readw(sdev->membase + LED_REG_OFFSET);
+ pr_debug("Read %d at %x\n", data, (int)(sdev->membase + LED_REG_OFFSET));
/* return data for user */
if (copy_to_user(buff, &data, count)) {
@@ -127,11 +101,11 @@ ssize_t led_write(struct file *fildes, const char __user *
u16 data = 0;
if (*offp != 0) { /* offset must be 0 */
- PDEBUG("offset %d\n", (int)*offp);
+ pr_debug("offset %d\n", (int)*offp);
return 0;
}
- PDEBUG("count %d\n", count);
+ pr_debug("count %d\n", count);
if (count > 2) { /* 16 bits max)*/
count = 2;
}
@@ -141,10 +115,10 @@ ssize_t led_write(struct file *fildes, const char __user *
return -EFAULT;
}
- PDEBUG("Write %d at %x\n",
+ pr_debug("Write %d at %x\n",
data,
- (int)(sdev->membase+LED_REG_OFFSET));
- iowrite16(data, sdev->membase+LED_REG_OFFSET);
+ (int)(sdev->membase + LED_REG_OFFSET));
+ writew(data, sdev->membase + LED_REG_OFFSET);
return count;
}
@@ -153,123 +127,141 @@ int led_open(struct inode *inode, struct file *filp)
{
/* Allocate and fill any data structure to be put in filp->private_data */
filp->private_data = container_of(inode->i_cdev, struct led_dev, cdev);
- PDEBUG("Led opened\n");
+ pr_debug("LED opened\n");
return 0;
}
-/* ******************************
- * Init and release functions
- * ******************************/
int led_release(struct inode *inode, struct file *filp)
{
struct led_dev *dev;
dev = container_of(inode->i_cdev, struct led_dev, cdev);
- PDEBUG("%s: released\n", dev->name);
+ pr_debug("%s: released\n", dev->name);
filp->private_data=NULL;
return 0;
}
-/**********************************
- * driver probe
- **********************************/
static int led_probe(struct platform_device *pdev)
{
- struct plat_led_port *dev = pdev->dev.platform_data;
- int result = 0; /* error return */
+ struct plat_led_port *pdata = pdev->dev.platform_data;
+ int ret = 0;
int led_major, led_minor;
- u16 data;
+ u16 ip_id;
struct led_dev *sdev;
+ struct resource *mem_res;
- PDEBUG("Led probing\n");
- PDEBUG("Register %s num %d\n", dev->name, dev->num);
+ pr_debug("LED probing\n");
+ pr_debug("Register %s num %d\n", pdata->name, pdata->num);
- /* check if ID is correct */
- data = ioread16(dev->membase+dev->idoffset);
- if (data != dev->idnum) {
- result = -1;
- printk(KERN_WARNING "For %s id:%d doesn't match with "
- "id read %d,\n is device present ?\n",
- dev->name, dev->idnum, data);
- goto error_id;
+ if (!pdata) {
+ dev_err(&pdev->dev, "Platform data required !\n");
+ return -ENODEV;
+ }
+
+ /* get resources */
+ mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "can't find mem resource\n");
+ return -EINVAL;
+ }
+
+ mem_res =
+ request_mem_region(mem_res->start, resource_size(mem_res),
+ pdev->name);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "iomem already in use\n");
+ return -EBUSY;
}
- /* allocate memory for sdev structure */
+ /* allocate memory for private structure */
sdev = kmalloc(sizeof(struct led_dev), GFP_KERNEL);
if (!sdev) {
- result = -ENOMEM;
- goto error_sdev_alloc;
+ ret = -ENOMEM;
+ goto out_release_mem;
}
- dev->sdev = sdev;
- sdev->membase = dev->membase;
- sdev->name = (char *)kmalloc((1+strlen(dev->name))*sizeof(char),
+
+ sdev->membase = ioremap(mem_res->start, resource_size(mem_res));
+ if (!sdev->membase) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto out_dev_free;
+ }
+ sdev->mem_res = mem_res;
+
+ /* check if ID is correct */
+ ip_id = readw(sdev->membase + pdata->idoffset);
+ if (ip_id != pdata->idnum) {
+ ret = -ENODEV;
+ printk(KERN_WARNING "For %s id:%d doesn't match with "
+ "id read %d,\n is device present ?\n",
+ pdata->name, pdata->idnum, ip_id);
+ goto out_iounmap;
+ }
+
+ pdata->sdev = sdev;
+ sdev->name = (char *)kmalloc((1+strlen(pdata->name))*sizeof(char),
GFP_KERNEL);
if (sdev->name == NULL) {
printk("Kmalloc name space error\n");
- goto error_name_alloc;
+ goto out_iounmap;
}
- if (strncpy(sdev->name, dev->name, 1+strlen(dev->name)) < 0) {
+ if (strncpy(sdev->name, pdata->name, 1+strlen(pdata->name)) < 0) {
printk("copy error");
- goto error_name_copy;
+ goto out_name_free;
}
/* Get the major and minor device numbers */
led_major = 252;
- led_minor = dev->num ;/* num come from plat_led_port data structure */
+ led_minor = pdata->num;
sdev->devno = MKDEV(led_major, led_minor);
- result = alloc_chrdev_region(&(sdev->devno), led_minor, 1, dev->name);
- if (result < 0) {
- printk(KERN_WARNING "%s: can't get major %d\n", dev->name, led_major);
- goto error_devno;
+ ret = alloc_chrdev_region(&(sdev->devno), led_minor, 1, pdata->name);
+ if (ret < 0) {
+ printk(KERN_WARNING "%s: can't get major %d\n", pdata->name, led_major);
+ goto out_name_free;
}
printk(KERN_INFO "%s: MAJOR: %d MINOR: %d\n",
- dev->name,
+ pdata->name,
MAJOR(sdev->devno),
MINOR(sdev->devno));
/* Init the cdev structure */
- PDEBUG("Init the cdev structure\n");
+ pr_debug("Init the cdev structure\n");
cdev_init(&sdev->cdev, &led_fops);
sdev->cdev.owner = THIS_MODULE;
sdev->cdev.ops = &led_fops;
/* Add the device to the kernel, connecting cdev to major/minor number */
- PDEBUG("%s:Add the device to the kernel, "
- "connecting cdev to major/minor number \n", dev->name);
- result = cdev_add(&sdev->cdev, sdev->devno, 1);
- if (result) {
- printk(KERN_WARNING "%s: can't add cdev\n", dev->name);
- goto error_cdev_add;
+ pr_debug("%s:Add the device to the kernel, "
+ "connecting cdev to major/minor number \n", pdata->name);
+ ret = cdev_add(&sdev->cdev, sdev->devno, 1);
+ if (ret) {
+ printk(KERN_WARNING "%s: can't add cdev\n", pdata->name);
+ goto out_cdev_free;
}
- /* initialize led value */
- data = 1;
- iowrite16(data, sdev->membase);
- PDEBUG("Wrote %x at %x\n", data, (int)(sdev->membase+LED_REG_OFFSET));
+ /* initialize LED value */
+ writew(1, sdev->membase);
/* OK module inserted ! */
- printk(KERN_INFO "Led module %s insered\n", dev->name);
+ printk(KERN_INFO "LED module %s inserted\n", pdata->name);
return 0;
- /* Errors management */
- /* delete the cdev structure */
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n", dev->name);
-error_cdev_add:
- /* free major and minor number */
+out_cdev_free:
unregister_chrdev_region(sdev->devno, 1);
- printk(KERN_INFO "%s: Led deleted\n", dev->name);
-error_devno:
-error_name_copy:
+ printk(KERN_INFO "%s: LED deleted\n", pdata->name);
+out_name_free:
kfree(sdev->name);
-error_name_alloc:
+out_iounmap:
+ iounmap(sdev->membase);
+out_dev_free:
kfree(sdev);
-error_sdev_alloc:
- printk(KERN_ERR "%s: not inserted\n", dev->name);
-error_id:
- return result;
+out_release_mem:
+ release_mem_region(mem_res->start, resource_size(mem_res));
+
+ return ret;
}
static int __devexit led_remove(struct platform_device *pdev)
@@ -277,21 +269,17 @@ static int __devexit led_remove(struct platform_device *pdev)
struct plat_led_port *dev = pdev->dev.platform_data;
struct led_dev *sdev = (*dev).sdev;
- PDEBUG("Unregister %s, number %d\n", dev->name, dev->num);
- /* delete the cdev structure */
- PDEBUG("cdev name : %s\n", sdev->name);
+ pr_debug("Unregister %s, number %d\n", dev->name, dev->num);
+ pr_debug("cdev name : %s\n", sdev->name);
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n", dev->name);
- /*error_cdev_add:*/
- /* free major and minor number */
+ pr_debug("%s:cdev deleted\n", dev->name);
unregister_chrdev_region(sdev->devno, 1);
- /*error_devno:*/
- /*error_name_copy:*/
kfree(sdev->name);
- /*error_name_alloc:*/
+ iounmap(sdev->membase);
kfree(sdev);
- /*error_sdev_alloc:*/
+ release_mem_region(sdev->mem_res->start, resource_size(sdev->mem_res));
printk(KERN_INFO "%s: deleted with success\n", dev->name);
+
return 0;
}
@@ -304,14 +292,11 @@ static struct platform_driver plat_led_driver = {
},
};
-/**********************************
- * Module management
- **********************************/
static int __init led_init(void)
{
int ret;
- PDEBUG("Platform driver name %s\n", plat_led_driver.driver.name);
+ pr_debug("Platform driver name %s\n", plat_led_driver.driver.name);
ret = platform_driver_register(&plat_led_driver);
return ret;
}
@@ -319,13 +304,13 @@ static int __init led_init(void)
static void led_exit(void)
{
platform_driver_unregister(&plat_led_driver);
- PDEBUG("driver unregistered\n");
+ pr_debug("driver unregistered\n");
}
module_init(led_init);
module_exit(led_exit);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Fabien Marteau <fab...@ar...>-ARMadeus Systems");
-MODULE_DESCRIPTION("Led device driver");
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
+MODULE_DESCRIPTION("Wishbone IP LED device driver");
diff --git a/target/linux/modules/fpga/wishbone_example/wb_led/led.h b/target/linux/modules/fpga/wishbone_example/wb_led/led.h
index 1c6802a..4762af4 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/led.h
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/led.h
@@ -1,9 +1,8 @@
/*
- ***********************************************************************
+ * Platform data for Wishbone LED IP driver
*
- * (c) Copyright 2007 Armadeus project
+ * (c) Copyright 2007-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
- * Driver for Wishbone led IP
*
* 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
@@ -18,55 +17,19 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
*/
#ifndef __LED_H__
#define __LED_H__
-#include <linux/version.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/cdev.h>
-#include <linux/ioport.h> /* request_mem_region */
-#include <linux/platform_device.h>
-
-#include <asm/uaccess.h> /* copy_to_user function */
-#include <asm/io.h> /* readw() writew() */
-#include <mach/hardware.h>
-
-#define LED_DEBUG
-#undef PDEBUG
-#ifdef LED_DEBUG
-# ifdef __KERNEL__
- /* for kernel spage */
-# define PDEBUG(fmt,args...) printk(KERN_DEBUG "LED : " fmt, ##args)
-# else
- /* for user space */
-# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
-# endif
-#else
-# define PDEBUG(fmt,args...) /* no debbuging message */
-#endif
-
-
-#define FPGA_BASE_ADDR IMX_CS1_PHYS
-#define FPGA_MEM_SIZE IMX_CS1_SIZE
-
-#define LED_NUMBER 1
-
#define LED_REG_OFFSET (0x00)
-#define LED_ID_OFFSET (0x02)
/* platform device */
struct plat_led_port {
const char *name; /* instance name */
int num; /* instance number */
- void *membase; /* virtual base address */
int idnum; /* identity number */
int idoffset; /* identity relative address */
struct led_dev *sdev; /* struct for main device structure*/
};
#endif /* __LED_H__ */
-
diff --git a/target/linux/modules/fpga/wishbone_twin_uart/16750.c b/target/linux/modules/fpga/wishbone_twin_uart/16750.c
new file mode 100644
index 0000000..20a418d
--- /dev/null
+++ b/target/linux/modules/fpga/wishbone_twin_uart/16750.c
@@ -0,0 +1,138 @@
+/*
+ * Platform data for OpenCore 16750 2x serial IP
+ * loaded in FPGA of the Armadeus boards.
+ *
+ * (C) Copyright 2008-2011 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/version.h>
+#include <linux/module.h>
+#include <linux/serial_8250.h>
+
+#include <asm/io.h>
+#ifndef CONFIG_MACH_APF9328 /* To remove when MX1 platform is merged */
+#include <mach/fpga.h>
+#endif
+
+#define GSM_UART_INPUT_CLOCK 96000000
+#define GSM_UART_BASE 0x20
+#define GSM_UART_IRQ IRQ_FPGA(0)
+
+#define GPS_UART_INPUT_CLOCK 96000000
+#define GPS_UART_BASE 0x40
+#define GPS_UART_IRQ IRQ_FPGA(1)
+
+
+void plat_uart_release(struct device *dev)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+ pr_debug("device %s released\n", dev->bus_id);
+#else
+ pr_debug("device %s released\n", dev->init_name);
+#endif
+}
+
+static struct plat_serial8250_port ocore_16750_uart0_data[] = {
+ {
+ .mapbase = ARMADEUS_FPGA_BASE_ADDR + GSM_UART_BASE,
+ .irq = IRQ_FPGA(0),
+ .uartclk = 96000000,
+ .regshift = 1,
+ .iotype = UPIO_MEM,
+ .flags = UPF_BOOT_AUTOCONF
+ }
+};
+
+static struct plat_serial8250_port ocore_16750_uart1_data[] = {
+ {
+ .mapbase = ARMADEUS_FPGA_BASE_ADDR + GPS_UART_BASE,
+ .irq = IRQ_FPGA(1),
+ .uartclk = 96000000,
+ .regshift = 1,
+ .iotype = UPIO_MEM,
+ .flags = UPF_BOOT_AUTOCONF
+ }
+};
+
+static struct platform_device ocore_16750_uart0_device = {
+ .name = "serial8250",
+ .id = 0,
+ .dev = {
+ .release = plat_uart_release,
+ .platform_data = ocore_16750_uart0_data,
+ },
+};
+
+static struct platform_device ocore_16750_uart1_device = {
+ .name = "serial8250",
+ .id = 1,
+ .dev = {
+ .release = plat_uart_release,
+ .platform_data = ocore_16750_uart1_data,
+ },
+};
+
+static int __init ocore_16750_init(void)
+{
+ int ret = -ENODEV;
+ u16 id;
+
+ ocore_16750_uart0_data[0].membase = ioremap(ocore_16750_uart0_data[0].mapbase, 0x20);
+ if (!ocore_16750_uart0_data[0].membase) {
+ printk(KERN_ERR "%s: ioremap failed\n", __func__);
+ return -ENOMEM;
+ }
+
+ /* check if ID is correct for GSM_UART */
+ id = readw(ocore_16750_uart0_data[0].membase + 0x08*2);
+ if (id != 2) {
+ printk(KERN_WARNING "For GSM_UART id:2 doesn't match with "
+ "id read %d,\n is device present ?\n", id);
+ return -ENODEV;
+ }
+
+ ocore_16750_uart1_data[0].membase = ioremap(ocore_16750_uart1_data[0].mapbase, 0x20);
+ if (!ocore_16750_uart1_data[0].membase) {
+ printk(KERN_ERR "%s: ioremap failed\n", __func__);
+ return -ENOMEM;
+ }
+
+ /* check if ID is correct for GPS_UART */
+ id = readw(ocore_16750_uart1_data[0].membase + 0x08*2);
+ if (id != 3) {
+ printk(KERN_WARNING "For GPS_UART id:3 doesn't match with "
+ "id read %d,\n is device present ?\n", id);
+ return -ENODEV;
+ }
+
+ ret = platform_device_register(&ocore_16750_uart0_device);
+ if (ret < 0)
+ return ret;
+
+ ret = platform_device_register(&ocore_16750_uart1_device);
+ if (ret < 0)
+ return ret;
+
+ return ret;
+}
+
+static void __exit ocore_16750_exit(void)
+{
+ platform_device_unregister(&ocore_16750_uart0_device);
+ platform_device_unregister(&ocore_16750_uart1_device);
+}
+
+module_init(ocore_16750_init);
+module_exit(ocore_16750_exit);
+
+MODULE_AUTHOR("Julien Boibessot, <jul...@ar...>");
+MODULE_DESCRIPTION("Platform data for 16750 OpenCore IP in Armadeus FPGA");
+MODULE_LICENSE("GPL");
diff --git a/target/linux/modules/fpga/POD/void/Makefile b/target/linux/modules/fpga/wishbone_twin_uart/Makefile
old mode 100755
new mode 100644
similarity index 54%
copy from target/linux/modules/fpga/POD/void/Makefile
copy to target/linux/modules/fpga/wishbone_twin_uart/Makefile
index 775eaa1..205a3f5
--- a/target/linux/modules/fpga/POD/void/Makefile
+++ b/target/linux/modules/fpga/wishbone_twin_uart/Makefile
@@ -1,24 +1,24 @@
#
-# Makefile for a generic Armadeus drivers
+# Makefile for the Armadeus FPGA serial "driver" (compatible with 16750/8250 OpenCore IP)
#
-# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_POD_DRIVERS) += void.o
+# Part executed when called from kernel build system:
+
+obj-$(CONFIG_SERIAL_8250) += 16750_ocore.o
+16750_ocore-objs := 16750.o
else
-# Part executed when called from standard make in this directory:
-
-ARMADEUS_BASE_DIR=../../../../../../
+ARMADEUS_BASE_DIR=../../../../..
include $(ARMADEUS_BASE_DIR)/Makefile.in
KDIR := $(ARMADEUS_LINUX_DIR)
PWD := $(shell pwd)
# Armadeus custom drivers common targets (default, clean, etc...)
-include ../../../Makefile.in
+include ../../Makefile.in
endif
diff --git a/target/linux/modules/fpga/wishbone_twin_uart/README b/target/linux/modules/fpga/wishbone_twin_uart/README
new file mode 100644
index 0000000..464187b
--- /dev/null
+++ b/target/linux/modules/fpga/wishbone_twin_uart/README
@@ -0,0 +1,8 @@
+To compile this driver from here:
+---------------------------------
+$ make
+
+To install this driver:
+-----------------------
+Copy resulting *.ko files on your target rootfs
+
diff --git a/target/test/test_fpga.sh b/target/test/test_fpga.sh
index c351b45..823e5b2 100755
--- a/target/test/test_fpga.sh
+++ b/target/test/test_fpga.sh
@@ -25,9 +25,17 @@ load_led()
load_fpga ./data/fpga/blinking_led_apf27_200k.bit
RES=$?
elif [ "$1" == "APF51" ]; then
- ask_user "Please power on FPGA bank XXX\nThen press enter"
- load_fpga ./data/fpga/blinking_led_apf51.bit
+ ask_user "Please power on FPGA Bank 1\nThen press enter"
+ load_fpga ./data/fpga/top_wishbone_example51.bin
RES=$?
+ if [ "$RES" == 0 ]; then
+ for i in `seq 5`; do
+ fpgaregs w 0x08 0x01
+ usleep 500000
+ fpgaregs w 0x08 0x00
+ usleep 500000
+ done
+ fi
else
echo "Platform not supported by this test"
fi
@@ -43,8 +51,8 @@ load_button()
load_fpga ./data/fpga/wishbone_example_apf27_200k.bit
RES=$?
elif [ "$1" == "APF51" ]; then
- echo "I hope you have powered up Bank XXX"
- load_fpga ./data/fpga/wishbone_example_apf51.bit
+ echo "I hope you have powered up Bank 1 with corresponding jumper"
+ load_fpga ./data/fpga/top_wishbone_example51.bin
RES=$?
else
echo "Platform not supported by this test"
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-05-16 12:40:48
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 38d9b8c222f030543a7d5ef727005fc7cb45981a (commit)
via e96e698e569228b81f64db3a1f0c99ffa85536b8 (commit)
from d0bcdfd0c7914788ec4c7ccc6909fa8fd236ad18 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 38d9b8c222f030543a7d5ef727005fc7cb45981a
Merge: e96e698e569228b81f64db3a1f0c99ffa85536b8 d0bcdfd0c7914788ec4c7ccc6909fa8fd236ad18
Author: Fabien Marteau <fab...@ar...>
Date: Mon May 16 14:40:11 2011 +0200
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit e96e698e569228b81f64db3a1f0c99ffa85536b8
Author: Fabien Marteau <fab...@ar...>
Date: Mon May 16 14:39:13 2011 +0200
[firmware][apf51] Adding script and bitstream to generate dual uarts design for apf51_dev with gsm and gps
-----------------------------------------------------------------------
Summary of changes:
.../gsm_gps_firmware.bin} | Bin 340604 -> 340604 bytes
firmware/scripts_pod/gsm_gps_firmware.pod | 23 ++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
copy firmware/{wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin => scripts_pod/gsm_gps_firmware.bin} (74%)
create mode 100644 firmware/scripts_pod/gsm_gps_firmware.pod
diff --git a/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin b/firmware/scripts_pod/gsm_gps_firmware.bin
similarity index 74%
copy from firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin
copy to firmware/scripts_pod/gsm_gps_firmware.bin
index 96c84f8..1bbb3ff 100644
Binary files a/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin and b/firmware/scripts_pod/gsm_gps_firmware.bin differ
diff --git a/firmware/scripts_pod/gsm_gps_firmware.pod b/firmware/scripts_pod/gsm_gps_firmware.pod
new file mode 100644
index 0000000..faaaad1
--- /dev/null
+++ b/firmware/scripts_pod/gsm_gps_firmware.pod
@@ -0,0 +1,23 @@
+project.create gsm_gps_firmware
+project.selectplatform standard.apf51
+project.addinstance components.uart16750 gsm_uart
+project.addinstance components.uart16750 gps_uart
+project.connectpin gsm_uart.interrupt.int_o.0 irq_mngr00.irq.irqport.0
+project.connectpin gps_uart.interrupt.int_o.0 irq_mngr00.irq.irqport.1
+project.connectpin gps_uart.uart.srx_pad_i.0 apf51.fpga.IO_L40P_M3DQ6_3
+project.connectpin gps_uart.uart.stx_pad_o.0 apf51.fpga.IO_L42N_GCLK24_M3LDM_3
+project.connectpin gsm_uart.uart.srx_pad_i.0 apf51.fpga.IO_L39P_M3LDQS_3
+project.connectpin gsm_uart.uart.stx_pad_o.0 apf51.fpga.IO_L41P_GCLK27_M3DQ4_3
+project.connectpin gsm_uart.uart.cts_pad_i.0 apf51.fpga.IO_L41N_GCLK26_M3DQ5_3
+project.connectpin gsm_uart.uart.rts_pad_o.0 apf51.fpga.IO_L39N_M3LDQSN_3
+project.autoconnectbus
+project.saveproject
+project.intercon imx51_wb16_wrapper00.mwb16
+project.top
+project.synthesis.selecttoolchain ise
+project.synthesis.generateproject
+project.driver.selecttoolchain armadeus
+#project.driver.selectprojecttree ../../target/linux/modules/fpga/POD/
+#project.driver.selectprojecttree >>>BSP_DIR<<</target/linux/modules/fpga/POD
+#project.driver.generateproject
+#project.driver.copydrivers
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-16 12:32:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d0bcdfd0c7914788ec4c7ccc6909fa8fd236ad18 (commit)
via 15825935c65f011451f49c88de2d1f956848716c (commit)
via 8a09bc863e3a44f485da20513e4cb6305bf6cb13 (commit)
from e1822083461afa622a4c03887084095a80576c5b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d0bcdfd0c7914788ec4c7ccc6909fa8fd236ad18
Merge: 15825935c65f011451f49c88de2d1f956848716c e1822083461afa622a4c03887084095a80576c5b
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 16 14:30:43 2011 +0200
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 15825935c65f011451f49c88de2d1f956848716c
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 16 14:29:10 2011 +0200
[LINUX] Cleanup wishbone_example/wb_button and make it work for APF51
commit 8a09bc863e3a44f485da20513e4cb6305bf6cb13
Author: Julien Boibessot <jul...@ar...>
Date: Fri May 6 12:35:39 2011 +0200
Indentation, cleanup and remove uneeded comments in target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
-----------------------------------------------------------------------
Summary of changes:
.../wishbone_example/wb_button/board_buttons.c | 38 ++-
.../fpga/wishbone_example/wb_button/button.c | 260 --------------------
.../fpga/wishbone_example/wb_button/button.h | 14 +-
.../wishbone_example/wb_button/button_specific.h | 14 -
.../fpga/wishbone_example/wb_button/gbutton.c | 244 +++++++++----------
5 files changed, 144 insertions(+), 426 deletions(-)
delete mode 100644 target/linux/modules/fpga/wishbone_example/wb_button/button.c
delete mode 100644 target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c b/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
index 345130d..d530265 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/board_buttons.c
@@ -1,7 +1,7 @@
/*
- * Specific button driver for generic button driver
+ * Platform data for generic button IP driver
*
- * (c) Copyright 2008 Armadeus project
+ * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
*
* This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <mach/hardware.h>
-#ifdef CONFIG_MACH_APF27 /* To remove when MX1 platform merged */
+#ifndef CONFIG_MACH_APF9328 /* To remove when MX1 platform is merged */
#include <mach/fpga.h>
#endif
@@ -32,25 +32,36 @@
#define BUTTON0_IRQ IRQ_FPGA(0)
+static struct resource button0_resources[] = {
+ [0] = {
+ .start = ARMADEUS_FPGA_BASE_ADDR + 0xc,
+ .end = ARMADEUS_FPGA_BASE_ADDR + 0xc + 0x4,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = BUTTON0_IRQ,
+ .end = BUTTON0_IRQ,
+ .flags = IORESOURCE_IRQ,
+ }
+};
static struct plat_button_port plat_button0_data = {
- .name = "BUTTON0",
- .interrupt_number = BUTTON0_IRQ,
- .num = 0,
- .membase = (void *)(ARMADEUS_FPGA_BASE_ADDR_VIRT + 0xc),
- .idnum = 3,
- .idoffset = 0x00 * (16 / 8)
+ .name = "BUTTON0",
+ .num = 0,
+ .idnum = 3,
+ .idoffset = 0x00 * (16 / 8)
};
static struct platform_device plat_button0_device = {
- .name = "button",
- .id = 0,
- .dev = {
+ .name = "button",
+ .id = 0,
+ .dev = {
.platform_data = &plat_button0_data
},
+ .num_resources = ARRAY_SIZE(button0_resources),
+ .resource = button0_resources,
};
-
static int __init board_button_init(void)
{
return platform_device_register(&plat_button0_device);
@@ -67,4 +78,3 @@ module_exit(board_button_exit);
MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
MODULE_DESCRIPTION("Board specific button driver");
MODULE_LICENSE("GPL");
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/button.c b/target/linux/modules/fpga/wishbone_example/wb_button/button.c
deleted file mode 100644
index 1e43ee0..0000000
--- a/target/linux/modules/fpga/wishbone_example/wb_button/button.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- ***********************************************************************
- *
- * (c) Copyright 2007 Armadeus project
- * Fabien Marteau <fab...@ar...>
- * Driver for Wb_button IP
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
- */
-
-#include <linux/version.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/cdev.h>
-#include <linux/semaphore.h>
-#include <linux/ioport.h> /* request_mem_region */
-#include <linux/jiffies.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-
-#include <asm/uaccess.h> /* copy_to_user function */
-#include <asm/io.h> /* readw() writew() */
-#include <mach/hardware.h>
-#include <asm/irq.h>
-
-/*#define BUTTON_DEBUG*/
-
-#undef PDEBUG
-#ifdef BUTTON_DEBUG
-# ifdef __KERNEL__
- /* for kernel spage */
-# define PDEBUG(fmt,args...) printk(KERN_INFO "button : " fmt, ##args)
-# else
- /* for user space */
-# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
-# endif
-#else
-# define PDEBUG(fmt,args...) /* no debugging message */
-#endif
-
-#include "button.h"
-
-/* Internal read/write helpers */
-
-static ssize_t button_fpga_read(void * addr, u16 *data, struct button_dev *dev)
-{
- *data = ioread16(addr); /* read the button value */
-
- return 2;
-}
-
-static ssize_t button_fpga_write(void * addr, u16 *data, struct button_dev *dev)
-{
- ssize_t retval;
-
- iowrite16(*data, addr); /* write the button value */
- retval = 2;
-
- return retval;
-}
-
-/* irq management; awake read process */
-static irqreturn_t fpga_interrupt(int irq, void *dev_id, struct pt_regs *reg)
-{
- struct button_dev *ldev = dev_id;
- u16 data;
-
- button_fpga_read(ldev->fpga_virtual_base_address + FPGA_IRQ_PEND, &data, ldev);
- PDEBUG("Interrupt raised %x\n", data);
-
- if (data & WB_BUTTON_IRQ) {
- /* wake up reading process */
- if (ldev->reading)
- up(&ldev->sem);
- /* acknowledge irq_mngr */
- button_fpga_write(ldev->fpga_virtual_base_address + FPGA_IRQ_ACK, &data, ldev);
- return IRQ_HANDLED;
- } else {
- return IRQ_NONE;
- }
-}
-
-/***********************************
- * characters file /dev operations
- * *********************************/
-ssize_t button_read(struct file *fildes, char __user *buff, size_t count, loff_t *offp)
-{
- struct button_dev *ldev = fildes->private_data;
- u16 data = 0;
- ssize_t retval = 0;
- DEFINE_WAIT(wait);
-
- ldev->reading = 1;
-
- if (*offp + count >= 1) /* Only one word can be read */
- count = 1 - *offp;
-
- if ((retval=down_interruptible(&ldev->sem)) < 0)
- goto out;
-
- if ((retval = button_fpga_read(ldev->fpga_virtual_base_address + FPGA_BUTTON, &data, ldev)) < 0)
- goto out;
-
- /* return data for user */
- if (copy_to_user(buff, &data, 2)) {
- printk(KERN_WARNING "read : copy to user data error\n");
- retval = -EFAULT;
- goto out;
- }
-
- *offp = *offp + count;
- retval = 1;
-
-out:
- PDEBUG("read : Return value %d\n", (int)retval);
- ldev->reading = 0;
-
- return retval;
-}
-
-int button_open(struct inode *inode, struct file *filp)
-{
- /* Allocate and fill any data structure to be put in filp->private_data */
- filp->private_data = container_of(inode->i_cdev, struct button_dev, cdev);
- PDEBUG("file opened\n");
-
- return 0;
-}
-
-int button_release(struct inode *inode, struct file *filp)
-{
- PDEBUG("released\n");
-
- return 0;
-}
-
-/**********************************
- * Module management
- **********************************/
-static int __init button_init(void)
-{
- int result;
- int button_major, button_minor;
- u16 data;
- struct button_dev *sdev;
-
- button_major = 252;
- button_minor = 0;
-
- /* Allocate a private structure and reference it as driver's data */
- sdev = (struct button_dev *)kmalloc(sizeof(struct button_dev), GFP_KERNEL);
- if (sdev == NULL) {
- printk(KERN_WARNING "button: unable to allocate private structure\n");
- return -ENOMEM;
- }
-
- /* initiate mutex locked */
- sdev->reading = 0;
- init_MUTEX_LOCKED(&sdev->sem);
-
- /* Get the major and minor device numbers */
- PDEBUG("Get the major and minor device numbers\n");
- if (button_major) {
- devno = MKDEV(button_major, button_minor);
- result = register_chrdev_region(devno, N_DEV,BUTTON_NAME);
- } else {
- result = alloc_chrdev_region(&devno, button_minor, N_DEV, BUTTON_NAME);
- button_major = MAJOR(devno);
- }
- printk(KERN_INFO "button: MAJOR: %d MINOR: %d\n", MAJOR(devno), MINOR(devno));
- if (result < 0) {
- printk(KERN_WARNING "button: can't get major %d\n", button_major);
- }
-
- /* Init the cdev structure */
- PDEBUG("Init the cdev structure\n");
- cdev_init(&sdev->cdev, &button_fops);
- sdev->cdev.owner = THIS_MODULE;
-
- /* Add the device to the kernel, connecting cdev to major/minor number */
- PDEBUG("Add the device to the kernel, connecting cdev to major/minor number\n");
- result = cdev_add(&sdev->cdev, devno, 1);
- if (result < 0)
- printk(KERN_WARNING "button: can't add cdev\n");
-
- /* Requested I/O memory */
- sdev->fpga_virtual_base_address = (void*)IMX_CS1_VIRT;
-
- /* irq unmask */
- data = 1 | ioread16(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK);
- if ((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK, &data, sdev)) < 0)
- goto error;
-
- /* irq acknowledge */
- data = 1;
- if ((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_ACK, &data, sdev)) < 0)
- goto error;
-
- /* irq registering */
- printk(KERN_INFO "button: fpga irq shared gpioa 1\n");
- if (request_irq(IRQ_GPIOA(1), (irq_handler_t)fpga_interrupt, IRQF_SHARED,BUTTON_IRQ_NAME, sdev) < 0) {
- printk(KERN_ERR "Can't request fpga irq\n");
- goto error;
- }
-
- /* OK driver ready ! */
- buttondev = sdev;
- printk(KERN_INFO "button module loaded\n");
- return 0;
-
-error:
- printk(KERN_ERR "%s: not loaded\n", BUTTON_NAME);
- free_all();
-
- return result;
-}
-
-static void __exit button_exit(void)
-{
- free_all();
-}
-
-static void free_all(void)
-{
- struct button_dev *sdev = buttondev;
-
- /* free irq*/
- free_irq(IRQ_GPIOA(1), sdev);
-
- /* delete the cdev structure */
- cdev_del(&sdev->cdev);
-
- /* Free the allocated memory */
- kfree(sdev);
-
- /* Release I/O memories */
- release_mem_region(FPGA_BASE_ADDR, FPGA_MEM_SIZE);
-
- /* free major and minor number */
- unregister_chrdev_region(devno, N_DEV);
- printk(KERN_INFO "button module unloaded\n");
-}
-
-module_init(button_init);
-module_exit(button_exit);
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/button.h b/target/linux/modules/fpga/wishbone_example/wb_button/button.h
index 7135e2d..590b9a7 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/button.h
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/button.h
@@ -1,9 +1,8 @@
/*
- ***********************************************************************
+ * Platform data for generic button IP driver
*
- * (c) Copyright 2007 Armadeus project
+ * (c) Copyright 2007-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
- * Driver for Wb_button IP
*
* 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
@@ -18,27 +17,22 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
*/
-
#ifndef __BUTTON_H__
#define __BUTTON_H__
#define BUTTON_NUMBER 1
-
#define BUTTON_REG_OFFSET (0x02)
#define BUTTON_ID_OFFSET (0x00)
/* platform device */
struct plat_button_port {
- const char *name; /*instance name */
- int interrupt_number; /* interrupt_number */
+ const char *name; /* instance name */
int num; /* instance number */
- void *membase; /* ioremap base address */
int idnum; /* identity number */
int idoffset; /* identity relative address */
- struct button_dev *sdev;/* struct for main device structure*/
+ struct button_dev *sdev;/* struct for main device structure */
};
#endif /* __BUTTON_H__ */
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h b/target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h
deleted file mode 100644
index fb7d9a2..0000000
--- a/target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define BUTTON_NAME "button"
-#define FPGA_BUTTON 8
-#define FPGA_IRQ_MASK 0
-#define FPGA_IRQ_PEND 2
-#define FPGA_IRQ_ACK 2
-
-/* Fpga base address for led */
-#define FPGA_BASE_ADDR IMX_CS1_PHYS
-#define FPGA_MEM_SIZE IMX_CS1_SIZE
-#define BUTTON_IRQ_NAME "button"
-
-/* interrupt position in irq_mngr */
-#define WB_BUTTON_IRQ 0x0001
-
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
index 6eb9122..a2ba158 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
+++ b/target/linux/modules/fpga/wishbone_example/wb_button/gbutton.c
@@ -1,9 +1,8 @@
/*
- ***********************************************************************
+ * Generic driver for Wishbone button IP
*
- * (c) Copyright 2008 Armadeus project
+ * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
- * Generic driver for Wishbone button IP
*
* 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
@@ -18,7 +17,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
*/
#include <linux/version.h>
@@ -36,29 +34,11 @@
#include <asm/uaccess.h> /* copy_to_user function */
#include <asm/io.h> /* readw() writew() */
#include <mach/hardware.h>
+#include <mach/fpga.h>
#include "button.h"
-/* for debugging messages*/
-//#define BUTTON_DEBUG
-
-#undef PDEBUG
-#ifdef BUTTON_DEBUG
-# ifdef __KERNEL__
-/* for kernel space */
-# define PDEBUG(fmt,args...) printk(KERN_DEBUG "BUTTON : " fmt, ##args)
-# else
-/* for user space */
-# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
-# endif
-#else
-# define PDEBUG(fmt,args...) /* no debbuging message */
-#endif
-
-/********************************
- * main device structure
- * ******************************/
struct button_dev {
char *name; /* name of the instance */
struct cdev cdev; /* char device structure */
@@ -66,16 +46,15 @@ struct button_dev {
void * membase; /* base address for instance */
dev_t devno; /* to store Major and minor numbers */
u8 read_in_wait; /* user is waiting for value to read */
+ struct resource *mem_res;
+ struct resource *irq_res;
};
-/***********************************
- * characters file /dev operations
- * *********************************/
ssize_t button_read(struct file *fildes, char __user *buff,
size_t count, loff_t *offp)
{
struct button_dev *ldev = fildes->private_data;
- u16 data=0;
+ u16 data = 0;
ssize_t retval = 0;
ldev->read_in_wait = 1;
@@ -83,12 +62,12 @@ ssize_t button_read(struct file *fildes, char __user *buff,
if (*offp + count >= 1) /* Only one word can be read */
count = 1 - *offp;
- if ((retval=down_interruptible(&ldev->sem)) < 0) {
+ if ((retval = down_interruptible(&ldev->sem)) < 0) {
goto out;
}
- data=ioread16(ldev->membase+BUTTON_REG_OFFSET);
- PDEBUG("Read %d at 0x%x\n",data,(unsigned int)ldev->membase+BUTTON_REG_OFFSET);
+ data = readw(ldev->membase + BUTTON_REG_OFFSET);
+ pr_debug("Read %d at 0x%x\n", data, (unsigned int)ldev->membase + BUTTON_REG_OFFSET);
/* return data for user */
if (copy_to_user(buff, &data, 2)) {
@@ -105,11 +84,10 @@ out:
return retval;
}
-
int button_open(struct inode *inode, struct file *filp)
{
/* Allocate and fill any data structure to be put in filp->private_data */
- filp->private_data = container_of(inode->i_cdev,struct button_dev, cdev);
+ filp->private_data = container_of(inode->i_cdev, struct button_dev, cdev);
return 0;
}
@@ -119,12 +97,11 @@ int button_release(struct inode *inode, struct file *filp)
struct button_dev *dev;
dev = container_of(inode->i_cdev, struct button_dev, cdev);
- filp->private_data=NULL;
+ filp->private_data = NULL;
return 0;
}
-
static struct file_operations button_fops = {
.owner = THIS_MODULE,
.read = button_read,
@@ -132,11 +109,6 @@ static struct file_operations button_fops = {
.release = button_release,
};
-/**********************************
- * irq management
- * awake read process
- * ********************************/
-
static irqreturn_t button_interrupt(int irq, void *dev_id)
{
struct button_dev *ldev = dev_id;
@@ -148,63 +120,94 @@ static irqreturn_t button_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-/**********************************
- * driver probe
- **********************************/
static int button_probe(struct platform_device *pdev)
{
- struct plat_button_port *dev = pdev->dev.platform_data;
-
- int result = 0; /* error return */
- int button_major,button_minor;
- u16 data;
+ struct plat_button_port *pdata = pdev->dev.platform_data;
+ int ret = 0;
+ int button_major, button_minor;
+ u16 ip_id;
struct button_dev *sdev;
-
- PDEBUG("Button probing\n");
- PDEBUG("Register %s num %d\n",dev->name,dev->num);
+ struct resource *mem_res;
+ struct resource *irq_res;
- /* check if ID is correct */
- data = ioread16(dev->membase+BUTTON_ID_OFFSET);
- if (data != dev->idnum) {
- result = -1;
- printk(KERN_WARNING "For %s id:%d doesn't match "
- "with id read %d,\n is device present ?\n",
- dev->name,dev->idnum,data);
- goto error_id;
+ pr_debug("Button probing\n");
+ pr_debug("Register %s num %d\n", pdata->name, pdata->num);
+
+ if (!pdata) {
+ dev_err(&pdev->dev, "Platform data required !\n");
+ return -ENODEV;
+ }
+
+ /* get resources */
+ mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "can't find mem resource\n");
+ return -EINVAL;
+ }
+ irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!irq_res) {
+ dev_err(&pdev->dev, "can't find irq resource\n");
+ return -EINVAL;
}
- /* allocate memory for sdev structure */
- sdev = kmalloc(sizeof(struct button_dev),GFP_KERNEL);
+ mem_res = request_mem_region(mem_res->start, resource_size(mem_res), pdev->name);
+ if (!mem_res) {
+ dev_err(&pdev->dev, "iomem already in use\n");
+ return -EBUSY;
+ }
+
+ /* allocate memory for private structure */
+ sdev = kmalloc(sizeof(struct button_dev), GFP_KERNEL);
if (!sdev) {
- result = -ENOMEM;
- goto error_sdev_alloc;
+ ret = -ENOMEM;
+ goto out_release_mem;
+ }
+
+ sdev->membase = ioremap(mem_res->start, resource_size(mem_res));
+ if (!sdev->membase) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto out_dev_free;
+ }
+ sdev->mem_res = mem_res;
+ sdev->irq_res = irq_res;
+
+ /* check if ID is correct */
+ ip_id = readw(sdev->membase + BUTTON_ID_OFFSET);
+ if (ip_id != pdata->idnum) {
+ ret = -ENODEV;
+ dev_warn(&pdev->dev, "For %s id:%d doesn't match "
+ "with id read %d,\n is device present ?\n",
+ pdata->name, pdata->idnum, ip_id);
+ goto out_iounmap;
}
- dev->sdev = sdev;
- sdev->membase = dev->membase;
- sdev->name = (char *)kmalloc((1+strlen(dev->name))*sizeof(char),
+
+ pdata->sdev = sdev;
+
+ sdev->name = (char *)kmalloc((1+strlen(pdata->name))*sizeof(char),
GFP_KERNEL);
if (sdev->name == NULL) {
- printk("Kmalloc name space error\n");
- goto error_name_alloc;
+ dev_err(&pdev->dev, "Kmalloc name space error\n");
+ goto out_iounmap;
}
- if (strncpy(sdev->name, dev->name, 1+strlen(dev->name)) < 0) {
+ if (strncpy(sdev->name, pdata->name, 1 + strlen(pdata->name)) < 0) {
printk("copy error");
- goto error_name_copy;
+ goto out_name_free;
}
/* Get the major and minor device numbers */
button_major = 251;
- button_minor = dev->num;
+ button_minor = pdata->num;
sdev->devno = MKDEV(button_major, button_minor);
- result = alloc_chrdev_region(&(sdev->devno), button_minor, 1,dev->name);
- if (result < 0) {
- printk(KERN_WARNING "%s: can't get major %d\n",
- dev->name,button_major);
- goto error_devno;
+ ret = alloc_chrdev_region(&(sdev->devno), button_minor, 1, pdata->name);
+ if (ret < 0) {
+ dev_warn(&pdev->dev, "%s: can't get major %d\n",
+ pdata->name, button_major);
+ goto out_name_free;
}
- printk(KERN_INFO "%s: MAJOR: %d MINOR: %d\n",
- dev->name,
+ dev_info(&pdev->dev, "%s: MAJOR: %d MINOR: %d\n",
+ pdata->name,
MAJOR(sdev->devno),
MINOR(sdev->devno));
@@ -213,108 +216,94 @@ static int button_probe(struct platform_device *pdev)
sema_init(&sdev->sem, 0);
/* Init the cdev structure */
- PDEBUG("Init the cdev structure\n");
- cdev_init(&sdev->cdev,&button_fops);
+ cdev_init(&sdev->cdev, &button_fops);
sdev->cdev.owner = THIS_MODULE;
sdev->cdev.ops = &button_fops;
- PDEBUG("%s: Add the device to the kernel, "
- "connecting cdev to major/minor number \n",dev->name);
- result = cdev_add(&sdev->cdev, sdev->devno, 1);
- if (result < 0) {
- printk(KERN_WARNING "%s: can't add cdev\n", dev->name);
- goto error_cdev_add;
+ pr_debug("%s: Add the device to the kernel, "
+ "connecting cdev to major/minor number \n", pdata->name);
+ ret = cdev_add(&sdev->cdev, sdev->devno, 1);
+ if (ret < 0) {
+ dev_warn(&pdev->dev, "%s: can't add cdev\n", pdata->name);
+ goto out_cdev_free;
}
/* irq registering */
- result = request_irq(dev->interrupt_number,
+ ret = request_irq(sdev->irq_res->start,
button_interrupt,
IRQF_SAMPLE_RANDOM,
sdev->name,
sdev);
- if (result < 0) {
+ if (ret < 0) {
printk(KERN_ERR "Can't register irq %d\n",
- dev->interrupt_number);
+ sdev->irq_res->start);
goto request_irq_error;
}
- printk(KERN_INFO "button: irq registered : %d\n",
- dev->interrupt_number);
/* OK driver ready ! */
- printk(KERN_INFO "%s loaded\n", dev->name);
+ printk(KERN_INFO "%s loaded\n", pdata->name);
return 0;
- /*********************/
- /* Errors management */
- /*********************/
- /* freeing irq */
- free_irq(dev->interrupt_number, sdev);
+ free_irq(sdev->irq_res->start, sdev);
request_irq_error:
- /* delete the cdev structure */
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n", dev->name);
-error_cdev_add:
- /* free major and minor number */
+ pr_debug("%s:cdev deleted\n", pdata->name);
+out_cdev_free:
unregister_chrdev_region(sdev->devno, 1);
- printk(KERN_INFO "%s: button deleted\n", dev->name);
-error_devno:
-error_name_copy:
+ printk(KERN_INFO "%s: button deleted\n", pdata->name);
+out_name_free:
kfree(sdev->name);
-error_name_alloc:
+out_iounmap:
+ iounmap(sdev->membase);
+out_dev_free:
kfree(sdev);
-error_sdev_alloc:
- printk(KERN_ERR "%s: not loaded\n", dev->name);
-error_id:
- return result;
+out_release_mem:
+ release_mem_region(mem_res->start, resource_size(mem_res));
+
+ return ret;
}
static int __devexit button_remove(struct platform_device *pdev)
{
- struct plat_button_port *dev = pdev->dev.platform_data;
- struct button_dev *sdev = (*dev).sdev;
+ struct plat_button_port *pdata = pdev->dev.platform_data;
+ struct button_dev *sdev = (*pdata).sdev;
- /* freeing irq */
- free_irq(dev->interrupt_number, sdev);
+ free_irq(sdev->irq_res->start, sdev);
- /* delete the cdev structure */
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n",dev->name);
+ pr_debug("%s:cdev deleted\n", pdata->name);
- /* free major and minor number */
unregister_chrdev_region(sdev->devno, 1);
- printk(KERN_INFO "%s: button deleted\n", dev->name);
+ printk(KERN_INFO "%s: button deleted\n", pdata->name);
kfree(sdev->name);
+ iounmap(sdev->membase);
kfree(sdev);
- printk(KERN_INFO "%s: deleted with success\n", dev->name);
+ release_mem_region(sdev->mem_res->start, resource_size(sdev->mem_res));
+ printk(KERN_INFO "%s: deleted with success\n", pdata->name);
return 0;
-
}
static struct platform_driver plat_button_driver =
{
.probe = button_probe,
.remove = __devexit_p(button_remove),
- .driver =
- {
+ .driver = {
.name = "button",
.owner = THIS_MODULE,
},
};
-/**********************************
- * Module management
- **********************************/
static int __init button_init(void)
{
int ret;
- PDEBUG("Platform driver name %s", plat_button_driver.driver.name);
+ pr_debug("Platform driver name %s", plat_button_driver.driver.name);
ret = platform_driver_register(&plat_button_driver);
if (ret) {
printk(KERN_ERR "Platform driver register error\n");
- return ret;
+ return ret;
}
return 0;
@@ -329,7 +318,6 @@ module_init(button_init);
module_exit(button_exit);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Fabien Marteau <fab...@ar...> "
- "- ARMadeus Systems");
-MODULE_DESCRIPTION("button device generic driver");
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
+MODULE_DESCRIPTION("Wishbone button IP generic driver");
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-05-12 09:03:53
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via e1822083461afa622a4c03887084095a80576c5b (commit)
from 499042ffeda3181646cdad4d108fc9a100c0b8e2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e1822083461afa622a4c03887084095a80576c5b
Author: Fabien Marteau <fab...@ar...>
Date: Thu May 12 11:02:51 2011 +0200
[firmware] Adding wishbone example for apf51
-----------------------------------------------------------------------
Summary of changes:
firmware/wishbone_example/wishbone_example51.pod | 14 +
.../binaries/top_wishbone_example51_lx9.bin | Bin 0 -> 340604 bytes
.../components/button00/button00.xml | 53 ++
.../components/button00/doc/README | 1 +
.../button00/drivers_templates/armadeus/Makefile | 37 ++
.../drivers_templates/armadeus/board_buttons.c | 92 ++++
.../button00/drivers_templates/armadeus/button.c | 226 ++++++++
.../button00/drivers_templates/armadeus/button.h | 99 ++++
.../drivers_templates/armadeus}/button_specific.h | 0
.../button00/drivers_templates/armadeus/gbutton.c | 360 +++++++++++++
.../drivers_templates/armadeus/testbutton.c | 90 ++++
.../components/button00/hdl/button.vhd | 98 ++++
.../components/imx51_wb16_wrapper00/doc/README | 15 +
.../hdl/imx51_wb16_wrapper.vhd | 87 ++++
.../imx51_wb16_wrapper00/imx51_wb16_wrapper00.xml | 102 ++++
.../hdl/imx51_wb16_wrapper00_mwb16_intercon.vhd | 168 ++++++
.../imx51_wb16_wrapper00_mwb16_intercon.xml | 83 +++
.../components/irq_mngr00/doc/README | 1 +
.../irq_mngr00/drivers_templates/armadeus/Makefile | 35 ++
.../irq_mngr00/drivers_templates/armadeus}/README | 0
.../irq_mngr00/drivers_templates/armadeus/main.c | 272 ++++++++++
.../irq_mngr00/drivers_templates/armadeus/test.c | 81 +++
.../components/irq_mngr00/hdl/irq_mngr.vhd | 154 ++++++
.../components/irq_mngr00/irq_mngr00.xml | 63 +++
.../wishbone_example51/components/led00/doc/README | 1 +
.../led00/drivers_templates/armadeus/Makefile | 36 ++
.../led00/drivers_templates/armadeus/board_leds.c | 87 ++++
.../led00/drivers_templates/armadeus/g_led.c | 354 +++++++++++++
.../led00/drivers_templates/armadeus/led.h | 98 ++++
.../led00/drivers_templates/armadeus/testled.c | 132 +++++
.../components/led00/hdl/led.vhd | 86 +++
.../wishbone_example51/components/led00/led00.xml | 52 ++
.../wishbone_example51/components/led00/wb8.xml | 48 ++
.../components/rstgen_syscon00/doc/README | 1 +
.../rstgen_syscon00/hdl/rstgen_syscon.vhd | 61 +++
.../components/rstgen_syscon00/rstgen_syscon00.xml | 32 ++
.../simulation/apf51_test_pkg.vhd | 150 ++++++
.../wishbone_example51/synthesis/button/button.vhd | 98 ++++
.../imx51_wb16_wrapper/imx51_wb16_wrapper.vhd | 87 ++++
.../imx51_wb16_wrapper00_mwb16_intercon.vhd | 168 ++++++
.../synthesis/irq_mngr/irq_mngr.vhd | 154 ++++++
.../wishbone_example51/synthesis/led/led.vhd | 86 +++
.../synthesis/rstgen_syscon/rstgen_syscon.vhd | 61 +++
.../wishbone_example51/synthesis/synthesis.xml | 7 +
.../synthesis/top_wishbone_example51.vhd | 545 ++++++++++++++++++++
.../synthesis/wishbone_example51.tcl | 23 +
.../synthesis/wishbone_example51.ucf | 27 +
.../wishbone_example51/wishbone_example51.xml | 132 +++++
.../{ => wishbone_example9328_27}/Makefile | 0
.../{ => wishbone_example9328_27}/README | 0
.../bin/wishbone_example_apf27_200k.bit | Bin 149603 -> 149603 bytes
.../bin/wishbone_example_apf9328_200k.bit | Bin 131038 -> 131038 bytes
.../{ => wishbone_example9328_27}/intercon.odg | Bin 14278 -> 14278 bytes
.../{ => wishbone_example9328_27}/src/button.vhd | 0
.../{ => wishbone_example9328_27}/src/intercon.vhd | 0
.../{ => wishbone_example9328_27}/src/irq_mngr.vhd | 0
.../{ => wishbone_example9328_27}/src/led.vhd | 0
.../src/rstgen_syscon.vhd | 0
.../src/top_wishbone_example.vhd | 0
.../src/wishbone_example_apf27.ucf | 0
.../src/wishbone_example_apf9328.ucf | 0
.../src/wishbone_wrapper.vhd | 0
.../testbench/apf_test_pkg.vhd | 0
.../testbench/top_wishbone_example_tb.vhd | 0
.../{ => wishbone_example9328_27}/wb_buttonled.odg | Bin 13989 -> 13989 bytes
65 files changed, 4657 insertions(+), 0 deletions(-)
create mode 100644 firmware/wishbone_example/wishbone_example51.pod
create mode 100644 firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/button00.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/doc/README
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/Makefile
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/board_buttons.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.h
copy {target/linux/modules/fpga/wishbone_example/wb_button => firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus}/button_specific.h (100%)
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/gbutton.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/button00/hdl/button.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/doc/README
create mode 100644 firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/hdl/imx51_wb16_wrapper.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/imx51_wb16_wrapper00.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00_mwb16_intercon/hdl/imx51_wb16_wrapper00_mwb16_intercon.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00_mwb16_intercon/imx51_wb16_wrapper00_mwb16_intercon.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/doc/README
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/drivers_templates/armadeus/Makefile
copy {target/linux/modules/fpga/wishbone_example/wb_irq_mngr => firmware/wishbone_example/wishbone_example51/components/irq_mngr00/drivers_templates/armadeus}/README (100%)
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/drivers_templates/armadeus/main.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/drivers_templates/armadeus/test.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/hdl/irq_mngr.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/irq_mngr00/irq_mngr00.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/doc/README
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/drivers_templates/armadeus/Makefile
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/drivers_templates/armadeus/board_leds.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/drivers_templates/armadeus/g_led.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/drivers_templates/armadeus/led.h
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/drivers_templates/armadeus/testled.c
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/hdl/led.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/led00.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/led00/wb8.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/components/rstgen_syscon00/doc/README
create mode 100644 firmware/wishbone_example/wishbone_example51/components/rstgen_syscon00/hdl/rstgen_syscon.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/components/rstgen_syscon00/rstgen_syscon00.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/simulation/apf51_test_pkg.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/button/button.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/imx51_wb16_wrapper/imx51_wb16_wrapper.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/imx51_wb16_wrapper00_mwb16/imx51_wb16_wrapper00_mwb16_intercon.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/irq_mngr/irq_mngr.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/led/led.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/rstgen_syscon/rstgen_syscon.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/synthesis.xml
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/top_wishbone_example51.vhd
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/wishbone_example51.tcl
create mode 100644 firmware/wishbone_example/wishbone_example51/synthesis/wishbone_example51.ucf
create mode 100644 firmware/wishbone_example/wishbone_example51/wishbone_example51.xml
rename firmware/wishbone_example/{ => wishbone_example9328_27}/Makefile (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/README (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/bin/wishbone_example_apf27_200k.bit (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/bin/wishbone_example_apf9328_200k.bit (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/intercon.odg (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/button.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/intercon.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/irq_mngr.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/led.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/rstgen_syscon.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/top_wishbone_example.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/wishbone_example_apf27.ucf (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/wishbone_example_apf9328.ucf (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/src/wishbone_wrapper.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/testbench/apf_test_pkg.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/testbench/top_wishbone_example_tb.vhd (100%)
rename firmware/wishbone_example/{ => wishbone_example9328_27}/wb_buttonled.odg (100%)
diff --git a/firmware/wishbone_example/wishbone_example51.pod b/firmware/wishbone_example/wishbone_example51.pod
new file mode 100644
index 0000000..8cad165
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51.pod
@@ -0,0 +1,14 @@
+project.create wishbone_example51
+project.selectplatform standard.apf51
+project.addinstance components.led.wb16
+project.addinstance components.button.wb16
+project.connectpin button00.int_button.irq irq_mngr00.irq.irqport.0
+project.connectpin button00.int_button.button apf51.fpga.IO_L41N_GCLK8_M1CASN_1
+project.connectpin led00.int_led.led apf51.fpga.IO_L41P_GCLK9_IRDY1_M1RASN_1
+project.autoconnectbus
+project.getmapping imx51_wb16_wrapper00
+project.getmapping imx51_wb16_wrapper00.mwb16
+project.intercon imx51_wb16_wrapper00.mwb16
+project.top
+project.synthesis.selecttoolchain ise
+project.synthesis.generateproject
diff --git a/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin b/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin
new file mode 100644
index 0000000..96c84f8
Binary files /dev/null and b/firmware/wishbone_example/wishbone_example51/binaries/top_wishbone_example51_lx9.bin differ
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/button00.xml b/firmware/wishbone_example/wishbone_example51/components/button00/button00.xml
new file mode 100644
index 0000000..153661f
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/button00.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component instance_name="button00" name="button" num="0" version="1.0">
+ <description>
+ A simple button ip
+ </description>
+ <driver_files>
+ <driver_templates architecture="armadeus">
+ <support version="3" />
+ <file name="Makefile" />
+ <file name="board_buttons.c" />
+ <file name="button.h" />
+ <file name="gbutton.c" />
+ <file name="testbutton.c" />
+ </driver_templates>
+ </driver_files>
+ <generics>
+ <generic destination="both" match="\d+" name="id" public="true" type="natural" value="3" />
+ </generics>
+ <hdl_files>
+ <hdl_file filename="button.vhd" istop="1" scope="both" />
+ </hdl_files>
+ <interrupts>
+ <interrupt interface="int_button" port="irq" />
+ </interrupts>
+ <interfaces>
+ <interface class="gls" name="int_button">
+ <ports>
+ <port dir="in" name="button" size="1" type="EXPORT" />
+ <port dir="out" name="irq" size="1" type="EXPORT" />
+ </ports>
+ </interface>
+ <interface class="clk_rst" name="candr">
+ <ports>
+ <port dir="in" name="gls_reset" size="1" type="RST" />
+ <port dir="in" name="gls_clk" size="1" type="CLK" />
+ </ports>
+ </interface>
+ <interface bus="wishbone16" class="slave" clockandreset="candr" name="swb16">
+ <registers base="0xc">
+ <register name="id" offset="0x00" rows="1" size="16" />
+ <register name="reg_button" offset="0x01" rows="1" size="16" />
+ </registers>
+ <ports>
+ <port dir="in" name="wbs_add" size="1" type="ADR" />
+ <port dir="out" name="wbs_readdata" size="16" type="DAT_O" />
+ <port dir="in" name="wbs_strobe" size="1" type="STB" />
+ <port dir="in" name="wbs_write" size="1" type="WE" />
+ <port dir="out" name="wbs_ack" size="1" type="ACK" />
+ <port dir="in" name="wbs_cycle" size="1" type="CYC" />
+ </ports>
+ </interface>
+ </interfaces>
+</component>
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/doc/README b/firmware/wishbone_example/wishbone_example51/components/button00/doc/README
new file mode 100644
index 0000000..6db0586
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/doc/README
@@ -0,0 +1 @@
+Ask fab...@ar... to document this
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/Makefile b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/Makefile
new file mode 100644
index 0000000..1a0482c
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/Makefile
@@ -0,0 +1,37 @@
+#
+# Makefile for the Armadeus Wb_button drivers
+#
+
+BASE_DIR="../../../../../buildroot/"
+
+REL=`grep "BR2_PACKAGE_LINUX_VERSION=" $(BASE_DIR).config | \
+ sed "s/BR2_PACKAGE_LINUX_VERSION=\\"//" | sed "s/\\"//"`
+
+ARMADEUS_KERNEL_DIR=$(BASE_DIR)build_arm/linux-$(REL)
+
+ifneq ($(KERNELRELEASE),)
+
+obj-$(CONFIG_POD_DRIVERS) += board_buttons.o gbutton.o
+
+# Part executed when called from standard make in this directory:
+# (preferably use Makefile in parent directory)
+
+else
+
+KDIR := $(ARMADEUS_KERNEL_DIR)
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+ -cp button.ko /tftpboot/
+
+test:
+ ~/armadeus/buildroot/build_arm/staging_dir/bin/arm-linux-gcc testbutton.c -o testbutton
+ chmod 755 testbutton
+
+clean:
+ rm -f *.*o \
+ rm -f Module.symvers
+
+endif
+
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/board_buttons.c b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/board_buttons.c
new file mode 100644
index 0000000..032bc7b
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/board_buttons.c
@@ -0,0 +1,92 @@
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2008 Armadeus project
+ * Fabien Marteau <fab...@ar...>
+ * Specific button driver for generic button driver
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#include <linux/config.h>
+#endif
+
+/* form module/drivers */
+#include <linux/init.h>
+#include <linux/module.h>
+
+/* for platform device */
+#include <linux/platform_device.h>
+#include <mach/hardware.h>
+#ifdef CONFIG_MACH_APF27 /* To remove when MX1 platform merged */
+#include <mach/fpga.h>
+#endif
+
+
+#include "button.h"
+
+/*$foreach:instance$*/
+#define /*$instance_name$*/_IRQ IRQ_FPGA(/*$interrupt_number$*/)
+/*$foreach:instance:end$*/
+
+/*$foreach:instance$*/
+static struct plat_button_port plat_button/*$instance_num$*/_data={
+ .name = "/*$instance_name$*/",
+ .interrupt_number=/*$instance_name$*/_IRQ,
+ .num=/*$instance_num$*/,
+ .membase = (void *)(ARMADEUS_FPGA_BASE_ADDR_VIRT +
+ /*$registers_base_address:swb16$*/),
+ .idnum=/*$generic:id$*/,
+ .idoffset=/*$register:swb16:id:offset$*/ * (/*$register:swb16:id:size$*/ /8)
+};
+/*$foreach:instance:end$*/
+
+/*$foreach:instance$*/
+static struct platform_device plat_button/*$instance_num$*/_device={
+ .name = "button",
+ .id=/*$instance_num$*/,
+ .dev={
+ .platform_data = &plat_button/*$instance_num$*/_data
+ },
+};
+/*$foreach:instance:end$*/
+
+static int __init board_button_init(void)
+{
+ int ret = -1;
+/*$foreach:instance$*/
+ ret = platform_device_register(&plat_button/*$instance_num$*/_device);
+ if(ret<0)return ret;
+/*$foreach:instance:end$*/
+ return ret;
+}
+
+static void __exit board_button_exit(void)
+{
+/*$foreach:instance$*/
+ platform_device_unregister(&plat_button/*$instance_num$*/_device);
+/*$foreach:instance:end$*/
+}
+
+module_init(board_button_init);
+module_exit(board_button_exit);
+
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
+MODULE_DESCRIPTION("Board specific button driver");
+MODULE_LICENSE("GPL");
+
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.c b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.c
new file mode 100644
index 0000000..71ab24b
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.c
@@ -0,0 +1,226 @@
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2007 Armadeus project
+ * Fabien Marteau <fab...@ar...>
+ * Driver for Wb_button IP
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
+
+#include "button.h"
+
+/*********************************
+ * simple fpga read/write
+ *********************************/
+
+
+static ssize_t button_fpga_read(void * addr,u16 *data,struct button_dev *dev){
+ *data = ioread16(addr);/* read the button value */
+ return 2;
+}
+
+
+static ssize_t button_fpga_write(void * addr,u16 *data,struct button_dev *dev){
+ ssize_t retval;
+
+ iowrite16(*data,addr);/* write the button value */
+ retval = 2;
+ return retval;
+}
+
+/**********************************
+ * irq management
+ * awake read process
+ * ********************************/
+
+static irqreturn_t fpga_interrupt(int irq,void *dev_id,struct pt_regs *reg){
+ struct button_dev *ldev = dev_id;
+ u16 data;
+
+ button_fpga_read(ldev->fpga_virtual_base_address + FPGA_IRQ_PEND,&data,ldev);
+ PDEBUG("Interrupt raised %x\n",data);
+
+ if(data&WB_BUTTON_IRQ){
+ /* wake up reading process */
+ if(ldev->reading)up(&ldev->sem);
+ /* acknowledge irq_mngr */
+ button_fpga_write(ldev->fpga_virtual_base_address + FPGA_IRQ_ACK,&data,ldev);
+ return IRQ_HANDLED;
+ }else
+ return IRQ_NONE;
+
+}
+
+/***********************************
+ * characters file /dev operations
+ * *********************************/
+ssize_t button_read(struct file *fildes, char __user *buff, size_t count, loff_t *offp){
+ struct button_dev *ldev = fildes->private_data;
+ u16 data=0;
+ ssize_t retval = 0;
+ DEFINE_WAIT(wait);
+
+ ldev->reading = 1;
+
+ if(*offp + count >= 1) /* Only one word can be read */
+ count = 1 - *offp;
+
+ if((retval=down_interruptible(&ldev->sem))<0)
+ goto out;
+
+ if((retval = button_fpga_read(ldev->fpga_virtual_base_address + FPGA_BUTTON,&data,ldev))<0)
+ goto out;
+
+ /* return data for user */
+ if(copy_to_user(buff,&data,2)){
+ printk(KERN_WARNING "read : copy to user data error\n");
+ retval = -EFAULT;
+ goto out;
+ }
+
+ *offp = *offp + count;
+ retval = 1;
+
+out:
+ PDEBUG("read : Return value %d\n",(int)retval);
+ ldev->reading = 0;
+ return retval;
+}
+
+
+int button_open(struct inode *inode, struct file *filp){
+ /* Allocate and fill any data structure to be put in filp->private_data */
+ filp->private_data = container_of(inode->i_cdev,struct button_dev, cdev);
+ PDEBUG( "file opened\n");
+ return 0;
+}
+
+/* ******************************
+ * Init and release functions
+ * ******************************/
+int button_release(struct inode *inode, struct file *filp){
+ PDEBUG( "released\n");
+ return 0;
+}
+
+/**********************************
+ * Module management
+ **********************************/
+static int __init button_init(void){
+
+ int result; /* error return */
+ int button_major,button_minor;
+ u16 data;
+ struct button_dev *sdev;
+
+ button_major = 252;
+ button_minor = 0;
+
+ /* Allocate a private structure and reference it as driver's data */
+ sdev = (struct button_dev *)kmalloc(sizeof(struct button_dev),GFP_KERNEL);
+ if(sdev == NULL){
+ printk(KERN_WARNING "button: unable to allocate private structure\n");
+ return -ENOMEM;
+ }
+
+ /* initiate mutex locked */
+ sdev->reading = 0;
+ init_MUTEX_LOCKED(&sdev->sem);
+
+ /* Get the major and minor device numbers */
+ PDEBUG("Get the major and minor device numbers\n");
+ if(button_major){
+ devno = MKDEV(button_major,button_minor);
+ result = register_chrdev_region(devno, N_DEV,BUTTON_NAME);
+ }else{
+ result = alloc_chrdev_region(&devno,button_minor,N_DEV,BUTTON_NAME);
+ button_major = MAJOR(devno);
+ }
+ printk(KERN_INFO "button: MAJOR: %d MINOR: %d\n",MAJOR(devno),MINOR(devno));
+ if(result < 0){
+ printk(KERN_WARNING "button: can't get major %d\n",button_major);
+ }
+
+ /* Init the cdev structure */
+ PDEBUG("Init the cdev structure\n");
+ cdev_init(&sdev->cdev,&button_fops);
+ sdev->cdev.owner = THIS_MODULE;
+
+ /* Add the device to the kernel, connecting cdev to major/minor number */
+ PDEBUG("Add the device to the kernel, connecting cdev to major/minor number \n");
+ result = cdev_add(&sdev->cdev,devno,1);
+ if(result < 0)printk(KERN_WARNING "button: can't add cdev\n");
+
+ /* Requested I/O memory */
+ sdev->fpga_virtual_base_address = (void*)IMX_CS1_VIRT;
+
+ /* irq unmask */
+ data=1 | ioread16(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK);
+ if((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_MASK,&data,sdev))<0)
+ goto error;
+
+ /* irq acknowledge */
+ data=1;
+ if((result=button_fpga_write(sdev->fpga_virtual_base_address + FPGA_IRQ_ACK,&data,sdev))<0)
+ goto error;
+
+ /* irq registering */
+ printk(KERN_INFO "button: fpga irq shared gpioa 1\n");
+ if(request_irq(IRQ_GPIOA(1),(irq_handler_t)fpga_interrupt,IRQF_SHARED,BUTTON_IRQ_NAME,sdev)<0){
+ printk(KERN_ERR "Can't request fpga irq\n");
+ goto error;
+ }
+
+
+ /* OK module inserted ! */
+ buttondev = sdev;
+ printk(KERN_INFO "button module insered\n");
+ return 0;
+
+
+error:
+ printk(KERN_ERR "%s: not inserted\n",BUTTON_NAME);
+ free_all();
+ return result;
+}
+
+static void __exit button_exit(void){
+ free_all();
+}
+
+static void free_all(void){
+ struct button_dev *sdev = buttondev;
+
+ /* free irq*/
+ free_irq(IRQ_GPIOA(1),sdev);
+
+ /* delete the cdev structure */
+ cdev_del(&sdev->cdev);
+
+ /* Free the allocated memory */
+ kfree(sdev);
+
+ /* Release I/O memories */
+ release_mem_region(FPGA_BASE_ADDR,FPGA_MEM_SIZE);
+
+ /* free major and minor number */
+ unregister_chrdev_region(devno,N_DEV);
+ printk(KERN_INFO "button module deleted\n");
+}
+
+module_init(button_init);
+module_exit(button_exit);
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.h b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.h
new file mode 100644
index 0000000..5676816
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button.h
@@ -0,0 +1,99 @@
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2007 Armadeus project
+ * Fabien Marteau <fab...@ar...>
+ * Driver for Wb_button IP
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
+
+
+#ifndef __BUTTON_H__
+#define __BUTTON_H__
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#include <linux/config.h>
+#endif
+
+/* form module/drivers */
+#include <linux/init.h>
+#include <linux/module.h>
+
+/* for file operations */
+#include <linux/fs.h>
+#include <linux/cdev.h>
+
+/* copy_to_user function */
+#include <asm/uaccess.h>
+
+/* request_mem_region */
+#include <linux/ioport.h>
+
+/* readw() writew() */
+#include <asm/io.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+/* hardware addresses */
+# include <asm/hardware.h>
+# include <asm/semaphore.h>
+#else
+# include <mach/hardware.h>
+# include <linux/semaphore.h>
+#endif
+
+/* interruptions */
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <linux/wait.h>
+
+/* measure time */
+#include <linux/jiffies.h>
+#endif
+
+/* for debugging messages*/
+/*#define BUTTON_DEBUG*/
+
+#undef PDEBUG
+#ifdef BUTTON_DEBUG
+# ifdef __KERNEL__
+ /* for kernel spage */
+# define PDEBUG(fmt,args...) printk(KERN_INFO "button : " fmt, ##args)
+# else
+ /* for user space */
+# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
+# endif
+#else
+# define PDEBUG(fmt,args...) /* no debbuging message */
+#endif
+
+#define BUTTON_NUMBER 1
+
+#define BUTTON_REG_OFFSET (0x02)
+#define BUTTON_ID_OFFSET (0x00)
+
+/* platform device */
+struct plat_button_port{
+ const char *name; /*instance name */
+ int interrupt_number; /* interrupt_number */
+ int num; /* instance number */
+ void * membase; /* ioremap base address */
+ int idnum; /* identity number */
+ int idoffset; /* identity relative address */
+ struct button_dev *sdev; /* struct for main device structure*/
+};
+
diff --git a/target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button_specific.h
similarity index 100%
copy from target/linux/modules/fpga/wishbone_example/wb_button/button_specific.h
copy to firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/button_specific.h
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/gbutton.c b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/gbutton.c
new file mode 100644
index 0000000..6a2aa4a
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/gbutton.c
@@ -0,0 +1,360 @@
+/*
+ ***********************************************************************
+ *
+ * (c) Copyright 2008 Armadeus project
+ * Fabien Marteau <fab...@ar...>
+ * Generic driver for Wishbone button IP
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#include <linux/config.h>
+#endif
+
+/* form module/drivers */
+#include <linux/init.h>
+#include <linux/module.h>
+
+/* for file operations */
+#include <linux/fs.h>
+#include <linux/cdev.h>
+
+/* copy_to_user function */
+#include <asm/uaccess.h>
+
+/* request_mem_region */
+#include <linux/ioport.h>
+
+/* readw() writew() */
+#include <asm/io.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+/* hardware addresses */
+# include <asm/hardware.h>
+#else
+# include <mach/hardware.h>
+#endif
+
+
+/* for platform device */
+#include <linux/platform_device.h>
+
+/* button */
+#include "button.h"
+
+
+/* for debugging messages*/
+//#define BUTTON_DEBUG
+
+#undef PDEBUG
+#ifdef BUTTON_DEBUG
+# ifdef __KERNEL__
+/* for kernel spage */
+# define PDEBUG(fmt,args...) printk(KERN_DEBUG "BUTTON : " fmt, ##args)
+# else
+/* for user space */
+# define PDEBUG(fmt,args...) printk(stderr, fmt, ##args)
+# endif
+#else
+# define PDEBUG(fmt,args...) /* no debbuging message */
+#endif
+
+/********************************
+ * main device structure
+ * ******************************/
+struct button_dev{
+ char *name; /* name of the instance */
+ struct cdev cdev; /* char device structure */
+ struct semaphore sem; /* mutex */
+ void * membase; /* base address for instance */
+ dev_t devno; /* to store Major and minor numbers */
+ u8 read_in_wait; /* user is waiting for value to read */
+};
+
+/***********************************
+ * characters file /dev operations
+ * *********************************/
+ssize_t button_read(struct file *fildes, char __user *buff,
+ size_t count, loff_t *offp)
+{
+ struct button_dev *ldev = fildes->private_data;
+ u16 data=0;
+ ssize_t retval = 0;
+
+ ldev->read_in_wait = 1;
+
+ if(*offp + count >= 1) /* Only one word can be read */
+ count = 1 - *offp;
+
+ if((retval=down_interruptible(&ldev->sem))<0)
+ {
+ goto out;
+ }
+
+ data=ioread16(ldev->membase+BUTTON_REG_OFFSET);
+ PDEBUG("Read %d at 0x%x\n",data,(unsigned int)ldev->membase + BUTTON_REG_OFFSET);
+
+ /* return data for user */
+ if(copy_to_user(buff,&data,2)){
+ printk(KERN_WARNING "read : copy to user data error\n");
+ retval = -EFAULT;
+ goto out;
+ }
+
+ *offp = *offp + count;
+ retval = 1;
+
+out:
+ ldev->read_in_wait = 0;
+ return retval;
+}
+
+
+int button_open(struct inode *inode, struct file *filp){
+ /* Allocate and fill any data structure to be put in filp->private_data */
+ filp->private_data = container_of(inode->i_cdev,struct button_dev, cdev);
+ return 0;
+}
+
+int button_release(struct inode *inode, struct file *filp)
+{
+ struct button_dev *dev;
+
+ dev = container_of(inode->i_cdev,struct button_dev,cdev);
+ filp->private_data=NULL;
+
+ return 0;
+}
+
+
+static struct file_operations button_fops = {
+ .owner = THIS_MODULE,
+ .read = button_read,
+ .open = button_open,
+ .release = button_release,
+};
+
+/**********************************
+ * irq management
+ * awake read process
+ * ********************************/
+
+static irqreturn_t button_interrupt(int irq,void *dev_id){
+ struct button_dev *ldev = dev_id;
+ /* wake up reading process */
+ if(ldev->read_in_wait)up(&ldev->sem);
+ /* acknowledge irq_mngr */
+ return IRQ_HANDLED;
+}
+
+/**********************************
+ * driver probe
+ **********************************/
+static int button_probe(struct platform_device *pdev)
+{
+ struct plat_button_port *dev = pdev->dev.platform_data;
+
+ int result = 0; /* error return */
+ int button_major,button_minor;
+ u16 data;
+ struct button_dev *sdev;
+
+ PDEBUG("Button probing\n");
+ PDEBUG("Register %s num %d\n",dev->name,dev->num);
+
+ /**************************/
+ /* check if ID is correct */
+ /**************************/
+ data = ioread16(dev->membase+BUTTON_ID_OFFSET);
+ if(data != dev->idnum){
+ result = -1;
+ printk(KERN_WARNING "For %s id:%d doesn't match "
+ "with id read %d,\n is device present ?\n",
+ dev->name,dev->idnum,data);
+ goto error_id;
+ }
+
+ /********************************************/
+ /* allocate memory for sdev structure */
+ /********************************************/
+ sdev = kmalloc(sizeof(struct button_dev),GFP_KERNEL);
+ if(!sdev){
+ result = -ENOMEM;
+ goto error_sdev_alloc;
+ }
+ dev->sdev = sdev;
+ sdev->membase = dev->membase;
+ sdev->name = (char *)kmalloc((1+strlen(dev->name))*sizeof(char),
+ GFP_KERNEL);
+ if (sdev->name == NULL) {
+ printk("Kmalloc name space error\n");
+ goto error_name_alloc;
+ }
+ if (strncpy(sdev->name,dev->name,1+strlen(dev->name)) < 0) {
+ printk("copy error");
+ goto error_name_copy;
+ }
+
+ /******************************************/
+ /* Get the major and minor device numbers */
+ /******************************************/
+ button_major = 251;
+ button_minor = dev->num;
+
+ sdev->devno = MKDEV(button_major, button_minor);
+ result = alloc_chrdev_region(&(sdev->devno),button_minor, 1,dev->name);
+ if (result < 0) {
+ printk(KERN_WARNING "%s: can't get major %d\n",
+ dev->name,button_major);
+ goto error_devno;
+ }
+ printk(KERN_INFO "%s: MAJOR: %d MINOR: %d\n",
+ dev->name,
+ MAJOR(sdev->devno),
+ MINOR(sdev->devno));
+
+ /* initiate mutex locked */
+ sdev->read_in_wait = 0;
+ init_MUTEX_LOCKED(&sdev->sem);
+
+ /****************************/
+ /* Init the cdev structure */
+ /****************************/
+ PDEBUG("Init the cdev structure\n");
+ cdev_init(&sdev->cdev,&button_fops);
+ sdev->cdev.owner = THIS_MODULE;
+ sdev->cdev.ops = &button_fops;
+
+ /* Add the device to the kernel, connecting cdev to major/minor number */
+ PDEBUG("%s: Add the device to the kernel, "
+ "connecting cdev to major/minor number \n",dev->name);
+ result = cdev_add(&sdev->cdev,sdev->devno,1);
+ if(result < 0){
+ printk(KERN_WARNING "%s: can't add cdev\n",dev->name);
+ goto error_cdev_add;
+ }
+
+ /* irq registering */
+ result = request_irq(dev->interrupt_number,
+ button_interrupt,
+ IRQF_SAMPLE_RANDOM,
+ sdev->name,
+ sdev);
+ if(result < 0){
+ printk(KERN_ERR "Can't register irq %d\n",
+ dev->interrupt_number);
+ goto request_irq_error;
+ }
+ printk(KERN_INFO "button: irq registered : %d\n",
+ dev->interrupt_number);
+
+ /* OK module inserted ! */
+ printk(KERN_INFO "%s insered\n",dev->name);
+ return 0;
+
+ /*********************/
+ /* Errors management */
+ /*********************/
+ /* freeing irq */
+ free_irq(dev->interrupt_number,sdev);
+request_irq_error:
+ /* delete the cdev structure */
+ cdev_del(&sdev->cdev);
+ PDEBUG("%s:cdev deleted\n",dev->name);
+error_cdev_add:
+ /* free major and minor number */
+ unregister_chrdev_region(sdev->devno,1);
+ printk(KERN_INFO "%s: Led deleted\n",dev->name);
+error_devno:
+error_name_copy:
+ kfree(sdev->name);
+error_name_alloc:
+ kfree(sdev);
+error_sdev_alloc:
+ printk(KERN_ERR "%s: not inserted\n", dev->name);
+error_id:
+ return result;
+}
+
+static int __devexit button_remove(struct platform_device *pdev)
+{
+ struct plat_button_port *dev = pdev->dev.platform_data;
+ struct button_dev *sdev = (*dev).sdev;
+ /* freeing irq */
+ free_irq(dev->interrupt_number,sdev);
+//request_irq_error:
+ /* delete the cdev structure */
+ cdev_del(&sdev->cdev);
+ PDEBUG("%s:cdev deleted\n",dev->name);
+//error_cdev_add:
+ /* free major and minor number */
+ unregister_chrdev_region(sdev->devno,1);
+ printk(KERN_INFO "%s: Led deleted\n",dev->name);
+//error_devno:
+//error_name_copy:
+ kfree(sdev->name);
+//error_name_alloc:
+ kfree(sdev);
+//error_sdev_alloc:
+ printk(KERN_INFO "%s: deleted with success\n", dev->name);
+//error_id:
+ return 0;
+
+}
+
+static struct platform_driver plat_button_driver =
+{
+ .probe = button_probe,
+ .remove = __devexit_p(button_remove),
+ .driver =
+ {
+ .name = "button",
+ .owner = THIS_MODULE,
+ },
+};
+
+/**********************************
+ * Module management
+ **********************************/
+static int __init button_init(void)
+{
+ int ret;
+
+ PDEBUG("Platform driver name %s",plat_button_driver.driver.name);
+ ret = platform_driver_register(&plat_button_driver);
+ if (ret) {
+ printk(KERN_ERR "Platform driver register error\n");
+ return ret;
+ }
+ return 0;
+}
+
+static void __exit button_exit(void)
+{
+ platform_driver_unregister(&plat_button_driver);
+}
+
+module_init(button_init);
+module_exit(button_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...> "
+ "- ARMadeus Systems");
+MODULE_DESCRIPTION("button device generic driver");
+
+
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c
new file mode 100644
index 0000000..8765669
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/drivers_templates/armadeus/testbutton.c
@@ -0,0 +1,90 @@
+/* a program to write/read values on fpga address map
+ * Fabien Marteau <fab...@ar...>
+ * 7 april 2008
+ * fpgaaccess.h
+ *
+ * (c) Copyright 2008 Armadeus project
+ * Fabien Marteau <fab...@ar...>
+ *
+ * A simple driver for reading and writing on
+ * fpga throught a character file /dev/fpgaaccess
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ **********************************************************************
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* file management */
+#include <sys/stat.h>
+#include <fcntl.h>
+
+/* as name said */
+#include <signal.h>
+
+/* sleep */
+#include <unistd.h>
+
+int fled;
+
+void quit(int pouet){
+ close(fled);
+ exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+ unsigned short i,j;
+
+ /* quit when Ctrl-C pressed */
+ signal(SIGINT, quit);
+
+ j=0;
+
+ printf( "Testing button driver\n" );
+
+ if(argc < 2){
+ perror("invalide arguments number\ntestled <button_filename>\n");
+ exit(EXIT_FAILURE);
+ }
+
+ fled=open(argv[1],O_RDWR);
+ if(fled<0){
+ perror("can't open file\n");
+ exit(EXIT_FAILURE);
+ }
+
+ while(1){
+ i = (i==0)?1:0;
+ fflush(stdout);
+
+ /* read value */
+ if(read(fled,&j,1)<0){
+ perror("read error\n");
+ exit(EXIT_FAILURE);
+ }
+ printf("Read %d\n",j);
+
+ if(lseek(fled,0,SEEK_SET)<0){
+ perror("lseek error\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ close(fled);
+ exit(0);
+}
+
diff --git a/firmware/wishbone_example/wishbone_example51/components/button00/hdl/button.vhd b/firmware/wishbone_example/wishbone_example51/components/button00/hdl/button.vhd
new file mode 100644
index 0000000..7aec507
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/button00/hdl/button.vhd
@@ -0,0 +1,98 @@
+---------------------------------------------------------------------------
+-- Company : ARMades Systems
+-- Author(s) : Fabien Marteau <fab...@ar...>
+--
+-- Creation Date : 10/03/2008
+-- File : button.vhd
+--
+-- Abstract :
+--
+---------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+---------------------------------------------------------------------------
+Entity button is
+---------------------------------------------------------------------------
+ generic(
+ id : natural := 2
+ );
+ port
+ (
+ -- global signals
+ gls_reset : in std_logic ;
+ gls_clk : in std_logic ;
+ -- Wishbone signals
+ wbs_add : in std_logic ;
+ wbs_readdata : out std_logic_vector( 15 downto 0);
+ wbs_strobe : in std_logic ;
+ wbs_cycle : in std_logic ;
+ wbs_write : in std_logic ;
+ wbs_ack : out std_logic;
+ -- irq
+ irq : out std_logic ;
+ -- fpga input
+ button : in std_logic
+ );
+end entity;
+
+
+---------------------------------------------------------------------------
+Architecture button_1 of button is
+ ---------------------------------------------------------------------------
+ signal button_r : std_logic ;
+ signal reg : std_logic_vector( 15 downto 0);
+begin
+
+ -- connect button
+ cbutton : process(gls_clk,gls_reset)
+ begin
+ if gls_reset = '1' then
+ reg <= (others => '0');
+ elsif rising_edge(gls_clk) then
+ reg <= "000000000000000"&button;
+ end if;
+ end process cbutton;
+
+
+ -- rise interruption
+ pbutton : process(gls_clk,gls_reset)
+ begin
+ if gls_reset = '1' then
+ irq <= '0';
+ button_r <= '0';
+ elsif rising_edge(gls_clk) then
+ if button_r /= button then
+ irq <= '1';
+ else
+ irq <= '0';
+ end if;
+ button_r <= button;
+ end if;
+ end process pbutton;
+
+ -- register reading process
+ pread : process(gls_clk,gls_reset)
+ begin
+ if(gls_reset = '1') then
+ wbs_ack <= '0';
+ wbs_readdata <= (others => '0');
+ elsif(rising_edge(gls_clk)) then
+ wbs_ack <= '0';
+ if(wbs_strobe = '1' and wbs_write = '0' and wbs_cycle = '1')then
+ wbs_ack <= '1';
+ if wbs_add = '0' then
+ wbs_readdata <= std_logic_vector(to_unsigned(id,16));
+ else
+ wbs_readdata <= reg;
+ end if;
+ else
+ wbs_readdata <= (others => '0');
+ end if;
+ end if;
+ end process pread;
+
+end architecture button_1;
+
diff --git a/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/doc/README b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/doc/README
new file mode 100644
index 0000000..60cc40e
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/doc/README
@@ -0,0 +1,15 @@
+imx51_wb16_wrapper component
+============================
+
+This component is designed to convert WEIM bus from i.MX51
+to Wisbone 16 bits bus.
+
+FPGA component
+--------------
+
+No registers
+
+ARMadeus linux driver
+---------------------
+
+TODO
diff --git a/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/hdl/imx51_wb16_wrapper.vhd b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/hdl/imx51_wb16_wrapper.vhd
new file mode 100644
index 0000000..5220c6c
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/hdl/imx51_wb16_wrapper.vhd
@@ -0,0 +1,87 @@
+-------------------------------------------------------------------------------
+--
+-- File : imx51_wb16_wrapper.vhd
+-- Related files : (none)
+--
+-- Author(s) : Fabien Marteau <fab...@ar...>
+-- Project : i.MX51 wrapper to Wishbone bus
+--
+-- Creation Date : 17/12/2010
+--
+-- Description : This is the top file of the IP
+-------------------------------------------------------------------------------
+-- Modifications :
+--
+-------------------------------------------------------------------------------
+
+library IEEE;
+ use IEEE.std_logic_1164.all;
+ use IEEE.numeric_std.all;
+
+---------------------------------------------------------------------------
+Entity imx51_wb16_wrapper is
+---------------------------------------------------------------------------
+port
+(
+ -- i.MX Signals
+ imx_da : inout std_logic_vector(15 downto 0);
+ imx_cs_n : in std_logic;
+ imx_rw : in std_logic ;
+ imx_adv : in std_logic ;
+
+ -- Global Signals
+ gls_reset : in std_logic;
+ gls_clk : in std_logic;
+
+ -- Wishbone interface signals
+ wbm_address : out std_logic_vector(15 downto 0); -- Address bus
+ wbm_readdata : in std_logic_vector(15 downto 0); -- Data bus for read access
+ wbm_writedata : out std_logic_vector(15 downto 0); -- Data bus for write access
+ wbm_strobe : out std_logic; -- Data Strobe
+ wbm_write : out std_logic; -- Write access
+ wbm_ack : in std_logic; -- acknowledge
+ wbm_cycle : out std_logic -- bus cycle in progress
+);
+end entity;
+
+---------------------------------------------------------------------------
+Architecture RTL of imx51_wb16_wrapper is
+---------------------------------------------------------------------------
+
+ signal write : std_logic;
+ signal read : std_logic;
+ signal strobe : std_logic;
+ signal writedata : std_logic_vector(15 downto 0);
+ signal address : std_logic_vector(15 downto 0);
+
+begin
+
+ -- ----------------------------------------------------------------------------
+ -- External signals synchronization process
+ -- ----------------------------------------------------------------------------
+ process(gls_clk, gls_reset)
+ begin
+ if(gls_reset='1') then
+ writedata <= (others => '0');
+ address <= (others => '0');
+ elsif(rising_edge(gls_clk)) then
+ if (imx_adv = '0') then
+ address <= imx_da;
+ else
+ writedata <= imx_da;
+ end if;
+ end if;
+ end process;
+ strobe <= not (imx_cs_n);
+ write <= (not (imx_cs_n)) and (not(imx_rw));
+ read <= (not (imx_cs_n)) and imx_rw;
+
+ wbm_address <= address;
+ wbm_writedata <= writedata when (write = '1') else (others => '0');
+ wbm_strobe <= strobe;
+ wbm_write <= write;
+ wbm_cycle <= strobe;
+
+ imx_da <= wbm_readdata when ((read = '1') and (strobe = '1')) else (others => 'Z');
+
+end architecture RTL;
diff --git a/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/imx51_wb16_wrapper00.xml b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/imx51_wb16_wrapper00.xml
new file mode 100644
index 0000000..046425c
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00/imx51_wb16_wrapper00.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component instance_name="imx51_wb16_wrapper00" name="imx51_wb16_wrapper" num="0" version="0.1">
+ <description>
+ Convert EIM i.mx51 bus into a Wishbone 16bits master bus.
+ </description>
+ <hdl_files>
+ <hdl_file filename="imx51_wb16_wrapper.vhd" istop="1" scope="spartan6" />
+ </hdl_files>
+ <interfaces>
+ <interface class="gls" name="eim">
+ <ports>
+ <port dir="inout" name="imx_da" size="16" type="EXPORT">
+ <pin num="0">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA0" />
+ </pin>
+ <pin num="1">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA1" />
+ </pin>
+ <pin num="2">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA2" />
+ </pin>
+ <pin num="3">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA3" />
+ </pin>
+ <pin num="4">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA4" />
+ </pin>
+ <pin num="5">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA5" />
+ </pin>
+ <pin num="6">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA6" />
+ </pin>
+ <pin num="7">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA7" />
+ </pin>
+ <pin num="8">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA8" />
+ </pin>
+ <pin num="9">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA9" />
+ </pin>
+ <pin num="10">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA10" />
+ </pin>
+ <pin num="11">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA11" />
+ </pin>
+ <pin num="12">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA12" />
+ </pin>
+ <pin num="13">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA13" />
+ </pin>
+ <pin num="14">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA14" />
+ </pin>
+ <pin num="15">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_DA15" />
+ </pin>
+ </port>
+ <port dir="in" name="imx_cs_n" size="1" type="EXPORT">
+ <pin num="0">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_CS1" />
+ </pin>
+ </port>
+ <port dir="in" name="imx_adv" size="1" type="EXPORT">
+ <pin num="0">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_LBA" />
+ </pin>
+ </port>
+ <port dir="in" name="imx_rw" size="1" type="EXPORT">
+ <pin num="0">
+ <connect instance_dest="apf51" interface_dest="fpga" pin_dest="0" port_dest="EIM_RW" />
+ </pin>
+ </port>
+ </ports>
+ </interface>
+ <interface class="clk_rst" name="candr">
+ <ports>
+ <port dir="in" name="gls_reset" size="1" type="RST" />
+ <port dir="in" name="gls_clk" size="1" type="CLK" />
+ </ports>
+ </interface>
+ <interface bus="wishbone16" class="master" clockandreset="candr" name="mwb16">
+ <ports>
+ <port dir="out" name="wbm_address" size="16" type="ADR" />
+ <port dir="in" name="wbm_readdata" size="16" type="DAT_I" />
+ <port dir="out" name="wbm_writedata" size="16" type="DAT_O" />
+ <port dir="out" name="wbm_strobe" size="1" type="STB" />
+ <port dir="out" name="wbm_write" size="1" type="WE" />
+ <port dir="in" name="wbm_ack" size="1" type="ACK" />
+ <port dir="out" name="wbm_cycle" size="1" type="CYC" />
+ </ports>
+ <slaves>
+ <slave instancename="irq_mngr00" interfacename="swb16" />
+ <slave instancename="led00" interfacename="swb16" />
+ <slave instancename="button00" interfacename="swb16" />
+ </slaves>
+ </interface>
+ </interfaces>
+</component>
diff --git a/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00_mwb16_intercon/hdl/imx51_wb16_wrapper00_mwb16_intercon.vhd b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00_mwb16_intercon/hdl/imx51_wb16_wrapper00_mwb16_intercon.vhd
new file mode 100644
index 0000000..194226a
--- /dev/null
+++ b/firmware/wishbone_example/wishbone_example51/components/imx51_wb16_wrapper00_mwb16_intercon/hdl/imx51_wb16_wrapper00_mwb16_intercon.vhd
@@ -0,0 +1,168 @@
+---------------------------------------------------------------------------
+-- Company : Automaticaly generated by POD
+-- Author(s) :
+--
+-- Creation Date : 2011-05-03
+-- File : imx51_wb16_wrapper00_mwb16.vhd
+--
+-- Abstract :
+-- Connect slaves to mwb16 from imx51_wb16_wrapper00
+--
+---------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+Entity imx51_wb16_wrapper00_mwb16 is
+ port
+ (
+
+ -- irq_mngr00_swb16 connection
+ irq_mngr00_wbs_s1_address : out std_logic_vector(1 downto 0);
+ irq_mngr00_wbs_s1_readdata : in std_logic_vector(15 downto 0);
+ irq_mngr00_wbs_s1_writedata : out std_logic_vector(15 downto 0);
+ irq_mngr00_wbs_s1_ack : in std_logic;
+ irq_mngr00_wbs_s1_strobe : out std_logic;
+ irq_mngr00_wbs_s1_cycle : out std_logic;
+ irq_mngr00_wbs_s1_write : out std_logic;
+
+ -- irq_mngr00_candr connection
+ irq_mngr00_gls_clk : out std_logic;
+ irq_mngr00_gls_reset : out std_logic;
+
+ -- led00_swb16 connection
+ led00_wbs_add : out std_logic;
+ led00_wbs_writedata : out std_logic_vector(15 downto 0);
+ led00_wbs_readdata : in std_logic_vector(15 downto 0);
+ led00_wbs_strobe : out std_logic;
+ led00_wbs_cycle : out std_logic;
+ led00_wbs_write : out std_logic;
+ led00_wbs_ack : in std_logic;
+
+ -- led00_candr connection
+ led00_gls_reset : out std_logic;
+ led00_gls_clk : out std_logic;
+
+ -- button00_swb16 connection
+ button00_wbs_add : out std_logic;
+ button00_wbs_readdata : in std_logic_vector(15 downto 0);
+ button00_wbs_strobe : out std_logic;
+ button00_wbs_write : out std_logic;
+ button00_wbs_ack : in std_logic;
+ button00_wbs_cycle : out std_logic;
+
+ -- button00_candr connection
+ button00_gls_reset : out std_logic;
+ button00_gls_clk : out std_logic;
+
+ -- imx51_wb16_wrapper00_mwb16 connection
+ imx51_wb16_wrapper00_wbm_address : in std_logic_vector(15 downto 0);
+ imx51_wb16_wrapper00_wbm_readdata : out std_logic_vector(15 downto 0);
+ imx51_wb16_wrapper00_wbm_writedata : in std_logic_vector(15 downto 0);
+ imx51_wb16_wrapper00_wbm_strobe : in std_logic;
+ imx51_wb16_wrapper00_wbm_write : i...
[truncated message content] |
|
From: Fabien M <fa...@us...> - 2011-05-11 15:24:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 499042ffeda3181646cdad4d108fc9a100c0b8e2 (commit)
from 9416e234e922e82d85eae0959f21c9b9225bdb06 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 499042ffeda3181646cdad4d108fc9a100c0b8e2
Author: Fabien Marteau <fab...@ar...>
Date: Wed May 11 17:22:12 2011 +0200
[linux] Select fpga by defaut in linux for apf27
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf27/apf27-linux-2.6.38.config | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
index 20146f3..70346da 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Fri Apr 29 14:10:32 2011
+# Tue May 10 13:46:36 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -287,7 +287,7 @@ CONFIG_MACH_MX27=y
# CONFIG_MACH_PCA100 is not set
# CONFIG_MACH_MXT_TD60 is not set
CONFIG_MACH_APF27=y
-# CONFIG_MACH_APF27_FPGA is not set
+CONFIG_MACH_APF27_FPGA=y
CONFIG_MACH_APF27_HAS_BASEBOARD=y
CONFIG_MACH_APF27_DEV=y
CONFIG_MACH_APF27_DEV_EXT_NONE=y
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-05-11 05:51:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 9416e234e922e82d85eae0959f21c9b9225bdb06 (commit)
from 46803acfafbb3148d4f942940611f6b666f80fb1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9416e234e922e82d85eae0959f21c9b9225bdb06
Author: Nicolas Colombain <nic...@ar...>
Date: Wed May 11 07:51:00 2011 +0200
[LINUX] APF51 fix erratic fpga load
-----------------------------------------------------------------------
Summary of changes:
.../fpga/dev_tools/loader/apf51-fpga-loader.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/target/linux/modules/fpga/dev_tools/loader/apf51-fpga-loader.c b/target/linux/modules/fpga/dev_tools/loader/apf51-fpga-loader.c
index 5bfc2d7..1b39b29 100644
--- a/target/linux/modules/fpga/dev_tools/loader/apf51-fpga-loader.c
+++ b/target/linux/modules/fpga/dev_tools/loader/apf51-fpga-loader.c
@@ -52,22 +52,19 @@ int apf51_fpga_pre(void)
{
#define EMI_CLK_SEL 1<<26
- /* change emi_clk_sel to ensure blck smaller than 50MHz */
- temp_clk = __raw_readl( MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
- __raw_writel( temp_clk | EMI_CLK_SEL, MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
-
temp_rcr1 = __raw_readl( MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1RCR1_ADDR );
__raw_writel( 0x01000010, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1RCR1_ADDR );
temp_wcr1 = __raw_readl(MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1WCR1_ADDR);
__raw_writel( 0x01000008, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1WCR1_ADDR );
+ /* change emi_clk_sel to ensure blck smaller than 50MHz */
+ temp_clk = __raw_readl( MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
+ __raw_writel( temp_clk | EMI_CLK_SEL, MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
+
/* FPGA PROG */
gpio_direction_output(CONFIG_SYS_FPGA_PRG, 1);
- /* FPGA PWR */
- gpio_direction_output(CONFIG_SYS_FPGA_PWR, 1);
-
/* FPGA SUSPEND */
gpio_direction_output(CONFIG_SYS_FPGA_SUSPEND, 1);
@@ -77,6 +74,9 @@ int apf51_fpga_pre(void)
/* FPGA INIT# */
gpio_direction_input(CONFIG_SYS_FPGA_INIT);
+ /* FPGA PWR */
+ gpio_direction_output(CONFIG_SYS_FPGA_PWR, 1);
+
cs1_base = ioremap(MX51_CS1_BASE_ADDR, SZ_4K);
return 0;
@@ -158,6 +158,7 @@ int apf51_fpga_post(void)
{
/* restore emi_clk_sel */
__raw_writel( temp_clk, MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
+ udelay(10);
__raw_writel( temp_rcr1, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1RCR1_ADDR );
__raw_writel( temp_wcr1, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1WCR1_ADDR );
@@ -169,6 +170,7 @@ int apf51_fpga_post(void)
int apf51_fpga_abort(void)
{
__raw_writel( temp_clk, MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)+ MXC_CCM_CBCDR );
+ udelay(10);
__raw_writel( temp_rcr1, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1RCR1_ADDR );
__raw_writel( temp_wcr1, MX51_IO_ADDRESS(MX51_WEIM_BASE_ADDR) + MXC_CS1WCR1_ADDR );
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-05-10 12:49:28
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 46803acfafbb3148d4f942940611f6b666f80fb1 (commit)
from a37bbee0f20ee304c24ad2c7c3a61e43313a99f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 46803acfafbb3148d4f942940611f6b666f80fb1
Author: Jeremie Scheer <jer...@ar...>
Date: Tue May 10 14:48:45 2011 +0200
[LINUX] [2.6.38.1] Fix flag CS5_BASE_ADDR in apf27.c (patch 281) to adapt it to Linux 2.6.38.1.
-----------------------------------------------------------------------
Summary of changes:
.../2.6.38/281-apf27-armadeus-add_apf27.c.patch | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
index fe25fe2..8126a2d 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/281-apf27-armadeus-add_apf27.c.patch
@@ -12,7 +12,7 @@ Signed-off-by: Kevin Joly <jol...@gm...>
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27.c 2011-04-11 18:32:16.857382999 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27.c 2011-05-10 14:19:07.000000000 +0200
@@ -0,0 +1,728 @@
+ /*
+ * apf27.c
@@ -649,7 +649,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
+static struct map_desc apf27_fpga_io_desc[] __initdata = {
+ {
+ .virtual = CS5_BASE_ADDR_VIRT,
-+ .pfn = __phys_to_pfn(CS5_BASE_ADDR),
++ .pfn = __phys_to_pfn(MX27_CS5_BASE_ADDR),
+ .length = CS5_SIZE,
+ .type = MT_DEVICE,
+ },
@@ -745,7 +745,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c 2011-04-11 18:32:16.857382999 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c 2011-05-10 14:05:29.000000000 +0200
@@ -0,0 +1,938 @@
+ /*
+ * apf27-dev.c
@@ -1688,7 +1688,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c 2011-04-11 18:32:16.861382996 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c 2011-05-10 14:05:29.000000000 +0200
@@ -0,0 +1,168 @@
+/*
+ * apf27-lcd.c
@@ -1861,7 +1861,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-lcd.c
Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c 2011-04-11 18:32:16.861382996 +0200
++++ linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c 2011-05-10 14:05:29.000000000 +0200
@@ -0,0 +1,175 @@
+ /*
+ * apf27-dev-ext-apw.c
@@ -2041,7 +2041,7 @@ Index: linux-2.6.38.1/arch/arm/mach-imx/apf27-dev-ext-apw.c
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-03-23 21:04:47.000000000 +0100
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-04-11 18:35:22.017382998 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-10 14:18:07.000000000 +0200
@@ -83,6 +83,7 @@
case MACH_TYPE_MX21ADS:
case MACH_TYPE_PCA100:
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-05-10 09:16:50
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via a37bbee0f20ee304c24ad2c7c3a61e43313a99f3 (commit)
from d6aae9b8b28aae76dfc16b373c108e5b44eb2ee7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a37bbee0f20ee304c24ad2c7c3a61e43313a99f3
Author: Nicolas Colombain <nic...@ar...>
Date: Tue May 10 11:16:15 2011 +0200
[U-BOOT] APF51 fix erratic fpga load
-----------------------------------------------------------------------
Summary of changes:
.../target/u-boot/u-boot-2010.03-401-apf51.patch | 23 ++++++++++---------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
index b72597d..14172fe 100644
--- a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
+++ b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
@@ -1390,7 +1390,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/fpga.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-2010.03/board/armadeus/apf51/fpga.c 2011-01-05 18:11:15.000000000 +0100
-@@ -0,0 +1,270 @@
+@@ -0,0 +1,271 @@
+/*
+ * (C) Copyright 2002-2010
+ * Nicolas Colombain <nic...@ar...>
@@ -1480,26 +1480,20 @@ Index: u-boot-2010.03/board/armadeus/apf51/fpga.c
+{
+#define EMI_CLK_SEL 1<<26
+
-+ /* change emi_clk_sel to ensure blck smaller than 50MHz */
-+ temp_clk = __REG(CCM_BASE_ADDR + CLKCTL_CBCDR);
-+ __REG(CCM_BASE_ADDR + CLKCTL_CBCDR) = temp_clk | EMI_CLK_SEL;
-+
+ temp_rcr1 = __REG(CONFIG_CS1RCR1_ADDR);
+ __REG(CONFIG_CS1RCR1_ADDR) = 0x01000010;
+
+ temp_wcr1 = __REG(CONFIG_CS1WCR1_ADDR);
+ __REG(CONFIG_CS1WCR1_ADDR) = 0x01000008;
+
++ /* change emi_clk_sel to ensure blck smaller than 50MHz */
++ temp_clk = __REG(CCM_BASE_ADDR + CLKCTL_CBCDR);
++ __REG(CCM_BASE_ADDR + CLKCTL_CBCDR) = temp_clk | EMI_CLK_SEL;
++
+ /* FPGA PROG */
+ imx_gpio_pin_set(CONFIG_SYS_FPGA_PRG, 1);
+ imx_gpio_pin_cfg_dir(CONFIG_SYS_FPGA_PRG, 1);
+
-+ /* FPGA PWR */
-+ imx_gpio_pin_set(CONFIG_SYS_FPGA_PWR, 1);
-+ imx_gpio_pin_cfg_dir(CONFIG_SYS_FPGA_PWR, 1);
-+
-+ printf("Enable fpga power\n");
-+
+ /* FPGA SUSPEND */
+ imx_gpio_pin_set(CONFIG_SYS_FPGA_SUSPEND, 1);
+ imx_gpio_pin_cfg_dir(CONFIG_SYS_FPGA_SUSPEND, 1);
@@ -1510,6 +1504,12 @@ Index: u-boot-2010.03/board/armadeus/apf51/fpga.c
+ /* FPGA INIT# */
+ imx_gpio_pin_cfg_dir(CONFIG_SYS_FPGA_INIT, 0);
+
++ /* FPGA PWR */
++ imx_gpio_pin_set(CONFIG_SYS_FPGA_PWR, 1);
++ imx_gpio_pin_cfg_dir(CONFIG_SYS_FPGA_PWR, 1);
++
++ printf("Enable fpga power\n");
++
+ return cookie;
+}
+
@@ -1627,6 +1627,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/fpga.c
+ PRINTF ("%s:%d: FPGA POST \n", __FUNCTION__, __LINE__);
+ /* restore emi_clk_sel */
+ __REG(CCM_BASE_ADDR + CLKCTL_CBCDR) = temp_clk;
++ udelay(10); /* wait a few us after emi_clk_sel change */
+ __REG(CONFIG_CS1RCR1_ADDR) = temp_rcr1;
+ __REG(CONFIG_CS1WCR1_ADDR) = temp_wcr1;
+ return cookie;
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-05 14:50:15
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d6aae9b8b28aae76dfc16b373c108e5b44eb2ee7 (commit)
from 4ecb820b831ad1aa26b0bbac6c214c578f19ab3f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d6aae9b8b28aae76dfc16b373c108e5b44eb2ee7
Author: Julien Boibessot <jul...@ar...>
Date: Thu May 5 16:49:38 2011 +0200
[DEBUG] Makes fpgaregs tool work also on APF51
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/fpgaregs/fpgaregs.mk | 8 ++++-
target/linux/debug/fpgaregs/Makefile | 10 +++++--
target/linux/debug/fpgaregs/fpga27regs.h | 22 -----------------
target/linux/debug/fpgaregs/fpgaregs.c | 29 +++++++++-------------
target/linux/debug/fpgaregs/fpgaregs.h | 23 ------------------
5 files changed, 25 insertions(+), 67 deletions(-)
delete mode 100644 target/linux/debug/fpgaregs/fpga27regs.h
delete mode 100644 target/linux/debug/fpgaregs/fpgaregs.h
diff --git a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
index b10800b..80696d5 100644
--- a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
+++ b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
@@ -4,14 +4,18 @@
#
#############################################################
-FPGAREGS_VER:=1.0
+FPGAREGS_VER:=1.1
FPGAREGS_SOURCE:=$(TOPDIR)/../target/linux/debug/fpgaregs/
FPGAREGS_DIR:=$(BUILD_DIR)/fpgaregs-$(FPGAREGS_VER)
FPGAREGS_CAT:=zcat
ifeq ($(BR2_CPU_NAME),"imx27")
FPGAREGS_BINARY:=fpga27regs
else
-FPGAREGS_BINARY:=fpgaregs
+ ifeq ($(BR2_CPU_NAME),"imx51")
+ FPGAREGS_BINARY:=fpga51regs
+ else
+ FPGAREGS_BINARY:=fpgaregs
+ endif
endif
FPGAREGS_TARGET_BINARY:=usr/bin/fpgaregs
diff --git a/target/linux/debug/fpgaregs/Makefile b/target/linux/debug/fpgaregs/Makefile
index f8a522d..ecff1f4 100644
--- a/target/linux/debug/fpgaregs/Makefile
+++ b/target/linux/debug/fpgaregs/Makefile
@@ -2,15 +2,19 @@ ifeq ($(CC),cc)
CC=arm-linux-gcc
endif
-all: fpgaregs fpga27regs
+all: fpgaregs fpga27regs fpga51regs
-fpgaregs: fpgaregs.c fpgaregs.h
+fpgaregs: fpgaregs.c
$(CC) -Wall fpgaregs.c -o $@
-fpga27regs: fpgaregs.c fpga27regs.h
+fpga27regs: fpgaregs.c
$(CC) -DIMX27 -Wall fpgaregs.c -o $@
+fpga51regs: fpgaregs.c
+ $(CC) -DIMX51 -Wall fpgaregs.c -o $@
+
clean:
rm -f *.o
rm -f fpgaregs
rm -f fpga27regs
+ rm -f fpga51regs
diff --git a/target/linux/debug/fpgaregs/fpga27regs.h b/target/linux/debug/fpgaregs/fpga27regs.h
deleted file mode 100644
index 4f52d34..0000000
--- a/target/linux/debug/fpgaregs/fpga27regs.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2008 armadeus systems
- * Author: Fabien Marteau <fab...@ar...>
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define PLATFORM "APF27"
-#define FPGA_ADDRESS 0xD6000000
diff --git a/target/linux/debug/fpgaregs/fpgaregs.c b/target/linux/debug/fpgaregs/fpgaregs.c
index d2fb585..21ee393 100644
--- a/target/linux/debug/fpgaregs/fpgaregs.c
+++ b/target/linux/debug/fpgaregs/fpgaregs.c
@@ -3,7 +3,7 @@
* fpgaregs.c
* a program to write/read 16/32 bits values on FPGA address map using mmap()
*
- * (c) Copyright 2008 Armadeus project
+ * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
* Modified by Sebastien Van Cauwenberghe <sv...@gm...>
*
@@ -24,27 +24,22 @@
#include <stdio.h>
#include <stdlib.h>
-
-/* file management */
-#include <sys/stat.h>
+#include <sys/stat.h> /* file management */
#include <fcntl.h>
-
-/* as name said */
#include <signal.h>
-
-/* sleep, write(), read() */
-#include <unistd.h>
-
-/* converting string */
-#include <string.h>
-
-/* memory management */
-#include <sys/mman.h>
+#include <unistd.h> /* sleep, write(), read() */
+#include <string.h> /* converting string */
+#include <sys/mman.h> /* memory management */
#ifdef IMX27
-# include "fpga27regs.h"
+# define PLATFORM "APF27"
+# define FPGA_ADDRESS 0xD6000000
+#elif IMX51
+# define PLATFORM "APF51"
+# define FPGA_ADDRESS 0xB8000000
#else
-# include "fpgaregs.h"
+# define PLATFORM "APF9328"
+# define FPGA_ADDRESS 0x12000000
#endif
#define WORD_ACCESS (2)
diff --git a/target/linux/debug/fpgaregs/fpgaregs.h b/target/linux/debug/fpgaregs/fpgaregs.h
deleted file mode 100644
index 84c558e..0000000
--- a/target/linux/debug/fpgaregs/fpgaregs.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2008 armadeus systems
- * Author: Fabien Marteau <fab...@ar...>
- *
- * 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, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define PLATFORM "APF9328"
-#define FPGA_ADDRESS 0x12000000
-
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-05 14:09:14
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 4ecb820b831ad1aa26b0bbac6c214c578f19ab3f (commit)
via 128b49a83b855ef2c7713d12dd8e3dc269abdd1e (commit)
via 9b40d36664cd7cba976639c56dacb60d9bdb0e0f (commit)
from 0c348c849bc39cc68d5892d176988b3ff85fd879 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4ecb820b831ad1aa26b0bbac6c214c578f19ab3f
Merge: 128b49a83b855ef2c7713d12dd8e3dc269abdd1e 0c348c849bc39cc68d5892d176988b3ff85fd879
Author: Julien Boibessot <jul...@ar...>
Date: Thu May 5 15:46:29 2011 +0200
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 128b49a83b855ef2c7713d12dd8e3dc269abdd1e
Author: Julien Boibessot <jul...@ar...>
Date: Thu May 5 15:30:56 2011 +0200
[LINUX] 2.6.38: Adds LEDs and watchdog drivers for APF51 PMIC in default config
commit 9b40d36664cd7cba976639c56dacb60d9bdb0e0f
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 15:34:13 2011 +0200
[LINUX] Adds the possibility to use i.MX watchdog on APF51
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 31 ++++++++++++++++++--
.../2.6.38/400-armadeus-add_apf51_module.patch | 26 +++++++++-------
.../408-armadeus-add_apf51-dev_baseboard.patch | 20 ++++---------
3 files changed, 48 insertions(+), 29 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index b324443..17ae00d 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Tue May 3 15:19:38 2011
+# Thu May 5 10:50:28 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -255,6 +255,7 @@ CONFIG_ARCH_MXC=y
# CONFIG_KEYBOARD_GPIO_POLLED is not set
CONFIG_IMX_HAVE_PLATFORM_FEC=y
CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS=y
+CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT=y
CONFIG_IMX_HAVE_PLATFORM_IMX_I2C=y
CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD=y
CONFIG_IMX_HAVE_PLATFORM_IMX_SSI=y
@@ -624,6 +625,7 @@ CONFIG_MAC80211_RC_MINSTREL_HT=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
# CONFIG_MAC80211_MESH is not set
+# CONFIG_MAC80211_LEDS is not set
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
@@ -916,6 +918,7 @@ CONFIG_RT2X00_LIB_USB=m
CONFIG_RT2X00_LIB=m
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
# CONFIG_RTL8192CE is not set
# CONFIG_WL1251 is not set
@@ -979,6 +982,7 @@ CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MCS is not set
CONFIG_KEYBOARD_IMX=m
@@ -1314,7 +1318,7 @@ CONFIG_WATCHDOG=y
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_WM831X_WATCHDOG is not set
+CONFIG_WM831X_WATCHDOG=m
# CONFIG_MAX63XX_WATCHDOG is not set
CONFIG_IMX2_WDT=m
@@ -1760,7 +1764,28 @@ CONFIG_MMC_SPI=m
# CONFIG_MMC_DW is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=m
+CONFIG_LEDS_GPIO_PLATFORM=y
+# CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_LP5523 is not set
+# CONFIG_LEDS_PCA955X is not set
+CONFIG_LEDS_WM831X_STATUS=m
+# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_BD2802 is not set
+# CONFIG_LEDS_LT3593 is not set
+# CONFIG_LEDS_TRIGGERS is not set
+
+#
+# LED Triggers
+#
# CONFIG_NFC_DEVICES is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_RTC_LIB=y
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index 38d9314..d53e66f 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-04-18 09:39:16.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-04-18 10:47:45.000000000 +0200
-@@ -162,4 +162,17 @@
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-03 16:22:02.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-03 16:49:55.000000000 +0200
+@@ -162,4 +162,16 @@
Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals.
@@ -11,9 +11,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
+ select SOC_IMX51
+ select IMX_HAVE_PLATFORM_IMX_UART
+ select IMX_HAVE_PLATFORM_IMX_I2C
-+ select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+ select IMX_HAVE_PLATFORM_MXC_NAND
-+ select IMX_HAVE_PLATFORM_SPI_IMX
++ select IMX_HAVE_PLATFORM_IMX2_WDT
+ select MXC_ULPI
+ help
+ Include support for Armadeus Systems APF51 System On Module. This
@@ -23,7 +22,7 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
===================================================================
--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-03-23 21:04:47.000000000 +0100
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-04-18 10:47:45.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-03 16:49:55.000000000 +0200
@@ -7,6 +7,7 @@
obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
@@ -35,8 +34,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-04-18 10:20:41.000000000 +0200
-@@ -0,0 +1,492 @@
++++ linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c 2011-05-03 16:50:51.000000000 +0200
+@@ -0,0 +1,495 @@
+/*
+ * Support for APF51 System On Module
+ * Copyright (C) 2010-2011 Armadeus Systems <su...@ar...>
@@ -504,8 +503,11 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
+ initialize_otg_port(NULL);
+ mxc_register_device(&mxc_usbdr_udc_device, &apf51_usbdr_device_pdata);
+ }
++
+ apf51_fpga_init();
+
++ imx51_add_imx2_wdt(0, NULL);
++
+#ifdef CONFIG_MACH_APF51_HAS_BASEBOARD
+ apf51_baseboard_init();
+#endif
@@ -531,8 +533,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-04-18 09:39:18.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-04-18 09:39:18.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-03 16:22:04.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h 2011-05-03 16:22:05.000000000 +0200
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -553,8 +555,8 @@ Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/uncompress.h
}
Index: linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h
===================================================================
---- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-04-18 09:39:18.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-04-18 09:39:18.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-03 16:22:05.000000000 +0200
++++ linux-2.6.38.1/arch/arm/plat-mxc/include/mach/irqs.h 2011-05-03 16:22:05.000000000 +0200
@@ -53,6 +53,8 @@
#define MXC_BOARD_IRQS 80
#elif defined CONFIG_MACH_APF27
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index a9ce579..1129a0b 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -4,17 +4,9 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-04-26 13:49:47.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-02 14:03:00.000000000 +0200
-@@ -167,12 +167,32 @@
- select SOC_IMX51
- select IMX_HAVE_PLATFORM_IMX_UART
- select IMX_HAVE_PLATFORM_IMX_I2C
-- select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
- select IMX_HAVE_PLATFORM_MXC_NAND
-- select IMX_HAVE_PLATFORM_SPI_IMX
- select MXC_ULPI
- help
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Kconfig 2011-05-03 16:37:52.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Kconfig 2011-05-03 16:42:37.000000000 +0200
+@@ -176,4 +176,26 @@
Include support for Armadeus Systems APF51 System On Module. This
includes specific configurations for the board and its peripherals.
@@ -43,8 +35,8 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-04-26 13:49:47.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-02 14:03:00.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/mach-mx5/Makefile 2011-05-03 16:36:56.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/Makefile 2011-05-03 16:42:37.000000000 +0200
@@ -8,6 +8,7 @@
obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -56,7 +48,7 @@ Index: linux-2.6.38.1/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-05-02 13:59:05.000000000 +0200
++++ linux-2.6.38.1/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-05-03 16:42:37.000000000 +0200
@@ -0,0 +1,468 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-05-04 13:20:33
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 0c348c849bc39cc68d5892d176988b3ff85fd879 (commit)
from 63e2c7a68b1e3334c42f9bffd0e4c8314caf7cd4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0c348c849bc39cc68d5892d176988b3ff85fd879
Author: Jeremie Scheer <jer...@ar...>
Date: Wed May 4 15:19:55 2011 +0200
[LINUX] [2.6.38.1] Do not export irq_desc structure in patch 199 anymore.
-----------------------------------------------------------------------
Summary of changes:
...nel_to_export_some_irq_handling_functions.patch | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
index 2d4de9b..73aba73 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
@@ -46,15 +46,3 @@ Index: linux-2.6.38.1/kernel/irq/irqdesc.c
struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node)
{
-Index: linux-2.6.38.1/include/linux/irqdesc.h
-===================================================================
---- linux-2.6.38.1.orig/include/linux/irqdesc.h 2011-05-04 11:12:35.000000000 +0200
-+++ linux-2.6.38.1/include/linux/irqdesc.h 2011-05-04 11:12:55.000000000 +0200
-@@ -85,6 +85,7 @@
- #ifndef CONFIG_SPARSE_IRQ
- extern struct irq_desc irq_desc[NR_IRQS];
- #endif
-+EXPORT_SYMBOL_GPL(irq_desc);
-
- /* Will be removed once the last users in power and sh are gone */
- extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-04 12:44:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 63e2c7a68b1e3334c42f9bffd0e4c8314caf7cd4 (commit)
via 24e9dd5d004bd3c6ef3d9637f055aff5893edb6e (commit)
via 5e95576f2bf958f00be8253693a8d4ba897d7bf7 (commit)
via b606ba6fd9bbf80d2de8924a02bbc57082b7b508 (commit)
via 7e675519d4059cc9bfc592adcd82d9449bc91112 (commit)
via 21f488b458062d586c51f97b67fe59a540bc7078 (commit)
via fe0c4c2c6944be0abca92b4046f0a8055d30d208 (commit)
via b77f83d2f67f25b74ef9e9d27b265298129e7e93 (commit)
from b55dff83c825c9461cbafeda422bb426c4984767 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 63e2c7a68b1e3334c42f9bffd0e4c8314caf7cd4
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 14:43:18 2011 +0200
[BUILDROOT] Add a custom config to test APF51 releases
commit 24e9dd5d004bd3c6ef3d9637f055aff5893edb6e
Merge: 5e95576f2bf958f00be8253693a8d4ba897d7bf7 b55dff83c825c9461cbafeda422bb426c4984767
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 14:39:33 2011 +0200
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 5e95576f2bf958f00be8253693a8d4ba897d7bf7
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 14:38:56 2011 +0200
[LINUX][TOOLS] Update load_fpga helper script to handle APF51 particularities
commit b606ba6fd9bbf80d2de8924a02bbc57082b7b508
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 14:37:34 2011 +0200
[LINUX] Makes fpgaloader compiles again from its directory
commit 7e675519d4059cc9bfc592adcd82d9449bc91112
Author: Julien Boibessot <jul...@ar...>
Date: Wed May 4 14:36:41 2011 +0200
[TEST] Update release test scripts to let them run on APF51 too.
commit 21f488b458062d586c51f97b67fe59a540bc7078
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 3 15:31:50 2011 +0200
[LINUX] 2.6.38/APF51: Remove DS1374 driver and makes WM8311 RTC the default (static) one
commit fe0c4c2c6944be0abca92b4046f0a8055d30d208
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 3 15:31:16 2011 +0200
[BUILDROOT] Backport ntp from latest BR
commit b77f83d2f67f25b74ef9e9d27b265298129e7e93
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 3 12:44:52 2011 +0200
[BUILDROOT] Makes fbtest compiles without errors
-----------------------------------------------------------------------
Summary of changes:
.../{apf51_defconfig => apf51test_defconfig} | 61 +++++++++-
buildroot/package/armadeus/testsuite/testsuite.mk | 2 +-
.../armadeus/apf51/apf51-linux-2.6.38.config | 6 +-
.../054-ntp-allow_ntpd_selection_or_not.patch | 56 ---------
.../buildroot/2010.11/119-fbtest-add_package.patch | 31 ++++-
...rsion_4.2.5p3_and_fix_glibc_build_failure.patch | 60 ++++++++++
...add_ntpdate_option_and_make_ntpd_optional.patch | 124 ++++++++++++++++++++
...ly_install_init_script_if_ntpd_is_enabled.patch | 52 ++++++++
.../linux/modules/fpga/dev_tools/loader/Makefile | 2 +-
.../linux/modules/fpga/dev_tools/loader/load_fpga | 23 ++++-
target/test/test_adc.sh | 96 +++++++++++-----
target/test/test_audio.sh | 51 +++++++--
target/test/test_backlight.sh | 18 +++-
target/test/test_bluetooth.sh | 33 ++++--
target/test/test_dac.sh | 40 +++++--
target/test/test_fpga.sh | 57 +++++----
target/test/test_gpio.sh | 112 ++++++++++++------
target/test/test_helpers.sh | 15 ++-
target/test/test_pwm.sh | 37 ++++--
target/test/test_rs232.sh | 47 +++++---
target/test/test_touchscreen.sh | 23 +++-
target/test/test_usb_device.sh | 26 ++++-
target/test/test_usb_host.sh | 2 +-
target/test/test_watchdog.sh | 21 +++-
target/test/test_wifi.sh | 31 ++++--
25 files changed, 766 insertions(+), 260 deletions(-)
copy buildroot/configs/{apf51_defconfig => apf51test_defconfig} (93%)
delete mode 100644 patches/buildroot/2010.11/054-ntp-allow_ntpd_selection_or_not.patch
create mode 100644 patches/buildroot/2010.11/149b-ntp-bump_to_version_4.2.5p3_and_fix_glibc_build_failure.patch
create mode 100644 patches/buildroot/2010.11/149c-ntp-add_ntpdate_option_and_make_ntpd_optional.patch
create mode 100644 patches/buildroot/2010.11/149d-ntp-only_install_init_script_if_ntpd_is_enabled.patch
diff --git a/buildroot/configs/apf51_defconfig b/buildroot/configs/apf51test_defconfig
similarity index 93%
copy from buildroot/configs/apf51_defconfig
copy to buildroot/configs/apf51test_defconfig
index 32f3dca..f24b6bb 100644
--- a/buildroot/configs/apf51_defconfig
+++ b/buildroot/configs/apf51test_defconfig
@@ -251,15 +251,36 @@ BR2_PACKAGE_BUSYBOX_CONFIG="target/device/armadeus/busybox-$(BR2_BUSYBOX_VERSION
# Armadeus specific tools/utilities
#
# BR2_PACKAGE_AD9889CTRL is not set
-# BR2_PACKAGE_AS_DEVICES is not set
+BR2_PACKAGE_AS_DEVICES=y
+BR2_PACKAGE_AS_DEVICES_TESTS=y
+BR2_PACKAGE_AS_DEVICES_CPP=y
+BR2_PACKAGE_AS_DEVICES_TESTS_CPP=y
# BR2_PACKAGE_CH7024CTRL is not set
-# BR2_PACKAGE_ARMADEUS_DEMOS is not set
+BR2_PACKAGE_ARMADEUS_DEMOS=y
+
+#
+# Choose the demos to install
+#
+BR2_PACKAGE_ARMADEUS_DEMOS_ARMANOID=y
+BR2_PACKAGE_ARMADEUS_DEMOS_BACKLIGHT=y
+# BR2_PACKAGE_ARMADEUS_DEMOS_GPIO is not set
+BR2_PACKAGE_ARMADEUS_DEMOS_GPS=y
+BR2_PACKAGE_ARMADEUS_DEMOS_INPUT=y
+BR2_PACKAGE_ARMADEUS_DEMOS_MUSIC_PLAYER=y
+BR2_PACKAGE_ARMADEUS_DEMOS_CAPTURE=y
+BR2_PACKAGE_ARMADEUS_DEMOS_OSCILLO=y
+BR2_PACKAGE_ARMADEUS_DEMOS_SHOW_IMAGE=y
+BR2_PACKAGE_ARMADEUS_DEMOS_TEST_LCD=y
+
+#
+# DEMOS_MCP25020 requires package iproute2
+#
BR2_PACKAGE_FPGAREGS=y
BR2_PACKAGE_IMXREGS=y
# BR2_PACKAGE_IMXSSI is not set
# BR2_PACKAGE_MAX5821CTRL is not set
# BR2_PACKAGE_ARMADEUS_PPS_UTILITIES is not set
-# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+BR2_PACKAGE_ARMADEUS_TESTSUITE=y
BR2_PACKAGE_TFP410CTRL=y
#
@@ -401,11 +422,35 @@ BR2_PACKAGE_STRACE=y
# BR2_PACKAGE_DIRECTFB is not set
# BR2_PACKAGE_FBDUMP is not set
# BR2_PACKAGE_FBGRAB is not set
-# BR2_PACKAGE_FBTEST is not set
+BR2_PACKAGE_FBTEST=y
BR2_PACKAGE_FBV=y
# BR2_PACKAGE_IMAGEMAGICK is not set
# BR2_PACKAGE_LINUX_FUSION is not set
-# BR2_PACKAGE_SDL is not set
+BR2_PACKAGE_SDL=y
+BR2_PACKAGE_SDL_FBCON=y
+BR2_PACKAGE_SDL_IMAGE=y
+
+#
+# SDL_image file format support
+#
+BR2_PACKAGE_SDL_IMAGE_BMP=y
+# BR2_PACKAGE_SDL_IMAGE_GIF is not set
+# BR2_PACKAGE_SDL_IMAGE_JPEG is not set
+# BR2_PACKAGE_SDL_IMAGE_LBM is not set
+# BR2_PACKAGE_SDL_IMAGE_PCX is not set
+# BR2_PACKAGE_SDL_IMAGE_PNG is not set
+# BR2_PACKAGE_SDL_IMAGE_PNM is not set
+# BR2_PACKAGE_SDL_IMAGE_TARGA is not set
+# BR2_PACKAGE_SDL_IMAGE_TIFF is not set
+# BR2_PACKAGE_SDL_IMAGE_XCF is not set
+# BR2_PACKAGE_SDL_IMAGE_XPM is not set
+# BR2_PACKAGE_SDL_IMAGE_XV is not set
+BR2_PACKAGE_SDL_MIXER=y
+# BR2_PACKAGE_SDL_SOUND is not set
+# BR2_PACKAGE_SDL_NET is not set
+BR2_PACKAGE_SDL_TTF=y
+# BR2_PACKAGE_SDL_GFX is not set
+# BR2_PACKAGE_SLIDESHOW is not set
#
# Demos
@@ -606,7 +651,7 @@ BR2_PACKAGE_ZLIB=y
# BR2_PACKAGE_ATK is not set
# BR2_PACKAGE_CAIRO is not set
# BR2_PACKAGE_FONTCONFIG is not set
-# BR2_PACKAGE_FREETYPE is not set
+BR2_PACKAGE_FREETYPE=y
BR2_PACKAGE_JPEG=y
# BR2_PACKAGE_LIBART is not set
# BR2_PACKAGE_GDK_PIXBUF is not set
@@ -665,6 +710,7 @@ BR2_PACKAGE_TSLIB=y
#
# BR2_PACKAGE_ENCHANT is not set
# BR2_PACKAGE_ICU is not set
+# BR2_PACKAGE_LIBICONV is not set
BR2_PACKAGE_NCURSES=y
BR2_PACKAGE_NCURSES_TARGET_PANEL=y
BR2_PACKAGE_NCURSES_TARGET_FORM=y
@@ -728,9 +774,10 @@ BR2_PACKAGE_IPROUTE2=y
# BR2_PACKAGE_NFS_UTILS is not set
# BR2_PACKAGE_NGIRCD is not set
BR2_PACKAGE_NTP=y
-# BR2_PACKAGE_NTP_NTPD is not set
# BR2_PACKAGE_NTP_SNTP is not set
# BR2_PACKAGE_NTP_NTP_KEYGEN is not set
+# BR2_PACKAGE_NTP_NTPD is not set
+BR2_PACKAGE_NTP_NTPDATE=y
# BR2_PACKAGE_NTP_NTPDC is not set
# BR2_PACKAGE_NTP_NTPQ is not set
# BR2_PACKAGE_NTP_TICKADJ is not set
diff --git a/buildroot/package/armadeus/testsuite/testsuite.mk b/buildroot/package/armadeus/testsuite/testsuite.mk
index 8c0e71a..358e406 100644
--- a/buildroot/package/armadeus/testsuite/testsuite.mk
+++ b/buildroot/package/armadeus/testsuite/testsuite.mk
@@ -4,7 +4,7 @@
#
#############################################################
-ARMADEUS-TESTSUITE_VER:=1.0
+ARMADEUS-TESTSUITE_VER:=1.1
ARMADEUS-TESTSUITE_SOURCE:=$(TOPDIR)/../target/test/
ARMADEUS-TESTSUITE_DIR:=$(BUILD_DIR)/armadeus-testsuite-$(ARMADEUS-TESTSUITE_VER)
ARMADEUS-TESTSUITE_CAT:=zcat
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index 7585d77..b324443 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Tue May 3 11:14:27 2011
+# Tue May 3 15:19:38 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1782,7 +1782,7 @@ CONFIG_RTC_INTF_DEV=y
# I2C RTC drivers
#
# CONFIG_RTC_DRV_DS1307 is not set
-CONFIG_RTC_DRV_DS1374=y
+# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
@@ -1828,7 +1828,7 @@ CONFIG_RTC_MXC=m
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
-CONFIG_RTC_DRV_WM831X=m
+CONFIG_RTC_DRV_WM831X=y
#
# on-CPU RTC drivers
diff --git a/patches/buildroot/2010.11/054-ntp-allow_ntpd_selection_or_not.patch b/patches/buildroot/2010.11/054-ntp-allow_ntpd_selection_or_not.patch
deleted file mode 100644
index a4df4f2..0000000
--- a/patches/buildroot/2010.11/054-ntp-allow_ntpd_selection_or_not.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Some systems might only want to install ntpdate without installing
-(and launching at each startup ntpd daemon). So makes the installation of
-ntpd selectable.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
-
-Would BR be interested ?
-
-Index: buildroot/package/ntp/Config.in
-===================================================================
---- buildroot.orig/package/ntp/Config.in 2011-01-27 15:22:57.000000000 +0100
-+++ buildroot/package/ntp/Config.in 2011-01-27 15:24:27.000000000 +0100
-@@ -6,6 +6,12 @@
-
- http://www.ntp.org/
-
-+config BR2_PACKAGE_NTP_NTPD
-+ bool "ntpd daemon"
-+ depends on BR2_PACKAGE_NTP
-+ help
-+ Install ntpd daemon
-+
- config BR2_PACKAGE_NTP_SNTP
- bool "sntp"
- depends on BR2_PACKAGE_NTP
-Index: buildroot/package/ntp/ntp.mk
-===================================================================
---- buildroot.orig/package/ntp/ntp.mk 2011-01-27 15:22:57.000000000 +0100
-+++ buildroot/package/ntp/ntp.mk 2011-01-27 15:24:27.000000000 +0100
-@@ -33,20 +33,20 @@
- NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
-
- define NTP_INSTALL_TARGET_CMDS
-- install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd
- test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
-- install -m 755 package/ntp/ntp.sysvinit $(TARGET_DIR)/etc/init.d/S49ntp
-- @if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \
-+ test -z "$(BR2_PACKAGE_NTP_NTPD)" || install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd ; \
-+ install -m 755 package/ntp/ntp.sysvinit $(TARGET_DIR)/etc/init.d/S49ntp ; \
-+ if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \
- install -m 755 -d $(TARGET_DIR)/etc/default ; \
- install -m 644 package/ntp/ntpd.etc.default $(TARGET_DIR)/etc/default/ntpd ; \
- fi
- endef
-
- define NTP_UNINSTALL_TARGET_CMDS
-- rm $(TARGET_DIR)/usr/sbin/ntpd
-+ rm -f $(TARGET_DIR)/usr/sbin/ntpd
- rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(NTP_INSTALL_FILES_y))
-- rm $(TARGET_DIR)/etc/init.d/S49ntp
-- rm $(TARGET_DIR)/etc/default/ntpd
-+ rm -f $(TARGET_DIR)/etc/init.d/S49ntp
-+ rm -f $(TARGET_DIR)/etc/default/ntpd
- endef
-
- NTP_POST_PATCH_HOOKS += NTP_PATCH_FIXUPS
diff --git a/patches/buildroot/2010.11/119-fbtest-add_package.patch b/patches/buildroot/2010.11/119-fbtest-add_package.patch
index 1e8581e..c765a1e 100644
--- a/patches/buildroot/2010.11/119-fbtest-add_package.patch
+++ b/patches/buildroot/2010.11/119-fbtest-add_package.patch
@@ -4,8 +4,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: buildroot/package/Config.in
===================================================================
---- buildroot.orig/package/Config.in 2011-01-27 15:25:01.000000000 +0100
-+++ buildroot/package/Config.in 2011-01-27 15:25:03.000000000 +0100
+--- buildroot.orig/package/Config.in 2011-05-03 12:35:51.000000000 +0200
++++ buildroot/package/Config.in 2011-05-03 12:36:09.000000000 +0200
@@ -106,6 +106,7 @@
if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/fbset/Config.in"
@@ -17,7 +17,7 @@ Index: buildroot/package/Config.in
Index: buildroot/package/fbtest/Config.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/fbtest/Config.in 2011-01-27 15:25:03.000000000 +0100
++++ buildroot/package/fbtest/Config.in 2011-05-03 12:35:51.000000000 +0200
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_FBTEST
+ bool "fbtest"
@@ -29,7 +29,7 @@ Index: buildroot/package/fbtest/Config.in
Index: buildroot/package/fbtest/fbtest.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/fbtest/fbtest.mk 2011-01-27 15:25:03.000000000 +0100
++++ buildroot/package/fbtest/fbtest.mk 2011-05-03 12:35:51.000000000 +0200
@@ -0,0 +1,51 @@
+#############################################################
+#
@@ -85,7 +85,7 @@ Index: buildroot/package/fbtest/fbtest.mk
Index: buildroot/package/fbtest/fbtest-20041102-1-page-mask.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/fbtest/fbtest-20041102-1-page-mask.patch 2011-01-27 15:25:03.000000000 +0100
++++ buildroot/package/fbtest/fbtest-20041102-1-page-mask.patch 2011-05-03 12:35:51.000000000 +0200
@@ -0,0 +1,36 @@
+--- fbtest-20041102-1.org/fb.c 2003-04-04 14:07:55.000000000 +0200
++++ fbtest-20041102-1/fb.c 2009-05-20 10:32:32.000000000 +0200
@@ -126,7 +126,7 @@ Index: buildroot/package/fbtest/fbtest-20041102-1-page-mask.patch
Index: buildroot/package/fbtest/fbtest-20041102-1-exe-target-name-change.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/fbtest/fbtest-20041102-1-exe-target-name-change.patch 2011-01-27 15:25:03.000000000 +0100
++++ buildroot/package/fbtest/fbtest-20041102-1-exe-target-name-change.patch 2011-05-03 12:35:51.000000000 +0200
@@ -0,0 +1,11 @@
+--- fbtest-20041102-1.org/Makefile 2009-05-21 10:16:05.000000000 +0200
++++ fbtest-20041102-1/Makefile 2009-05-21 10:17:47.000000000 +0200
@@ -142,7 +142,7 @@ Index: buildroot/package/fbtest/fbtest-20041102-1-exe-target-name-change.patch
Index: buildroot/package/fbtest/fbtest-20041102-1-pnmtohex-libs-depends.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/fbtest/fbtest-20041102-1-pnmtohex-libs-depends.patch 2011-01-27 15:25:03.000000000 +0100
++++ buildroot/package/fbtest/fbtest-20041102-1-pnmtohex-libs-depends.patch 2011-05-03 12:35:51.000000000 +0200
@@ -0,0 +1,11 @@
+--- fbtest-20041102-1.org/pnmtohex/Makefile 2004-11-02 09:43:02.000000000 +0100
++++ fbtest-20041102-1/pnmtohex/Makefile 2005-11-16 22:24:08.406157582 +0100
@@ -155,3 +155,20 @@ Index: buildroot/package/fbtest/fbtest-20041102-1-pnmtohex-libs-depends.patch
+
+ include $(TOPDIR)/Rules.make
+
+Index: buildroot/package/fbtest/fbtest-20041102-correct_struct_fb_var_screeninfo.reserved_usage.patch
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ buildroot/package/fbtest/fbtest-20041102-1-correct_struct_fb_var_screeninfo.reserved_usage.patch 2011-05-03 12:40:49.000000000 +0200
+@@ -0,0 +1,12 @@
++struct fb_var_screeninfo has only 5 bytes available in "reserved[]" table.
++
++--- fbtest-20041102-1/fb.c 2011-05-03 11:53:28.000000000 +0200
+++++ fbtest-20041102-1.mod/fb.c 2011-05-03 12:30:34.000000000 +0200
++@@ -341,7 +341,6 @@
++ CHECK_CHANGE(reserved[2]);
++ CHECK_CHANGE(reserved[3]);
++ CHECK_CHANGE(reserved[4]);
++- CHECK_CHANGE(reserved[5]);
++
++ var_validate();
++ }
diff --git a/patches/buildroot/2010.11/149b-ntp-bump_to_version_4.2.5p3_and_fix_glibc_build_failure.patch b/patches/buildroot/2010.11/149b-ntp-bump_to_version_4.2.5p3_and_fix_glibc_build_failure.patch
new file mode 100644
index 0000000..0ed63c5
--- /dev/null
+++ b/patches/buildroot/2010.11/149b-ntp-bump_to_version_4.2.5p3_and_fix_glibc_build_failure.patch
@@ -0,0 +1,60 @@
+From 34c56e014ff44329416b609e1be208fd8e2ad4bf Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gu...@za...>
+Date: Thu, 27 Jan 2011 16:24:10 +0000
+Subject: ntp: bump to version 4.2.6p3 and fix glibc build failure
+
+Bump to version 4.2.6p3 and fix a build failure with external toolchains
+that use certain glibc versions as point out by speakman on IRC.
+
+Signed-off-by: Gustavo Zacarias <gu...@za...>
+Acked-by: Daniel Nyström <dan...@ti...>
+Signed-off-by: Peter Korsgaard <ja...@su...>
+---
+diff --git a/package/ntp/ntp-4.2.6_p2-adjtimex.patch b/package/ntp/ntp-adjtimex.patch
+index 40625fa..40625fa 100644
+--- a/package/ntp/ntp-4.2.6_p2-adjtimex.patch
++++ b/package/ntp/ntp-adjtimex.patch
+diff --git a/package/ntp/ntp-nano.patch b/package/ntp/ntp-nano.patch
+new file mode 100644
+index 0000000..d16046c
+--- a/dev/null
++++ b/package/ntp/ntp-nano.patch
+@@ -0,0 +1,23 @@
++Fixes issues with glibc header files, see
++http://bugs.gentoo.org/show_bug.cgi?id=270483
++
++Signed-off-by: Gustavo Zacarias <gu...@za...>
++
++diff -Nura ntp-4.2.6p2.orig/include/ntp_syscall.h ntp-4.2.6p2/include/ntp_syscall.h
++--- ntp-4.2.6p2.orig/include/ntp_syscall.h 2009-12-09 04:36:37.000000000 -0300
+++++ ntp-4.2.6p2/include/ntp_syscall.h 2011-01-27 13:09:05.072336628 -0300
++@@ -14,6 +14,14 @@
++ # include <sys/timex.h>
++ #endif
++
+++#if defined(ADJ_NANO) && !defined(MOD_NANO)
+++#define MOD_NANO ADJ_NANO
+++#endif
+++
+++#if defined(ADJ_TAI) && !defined(MOD_TAI)
+++#define MOD_TAI ADJ_TAI
+++#endif
+++
++ #ifndef NTP_SYSCALLS_LIBC
++ #ifdef NTP_SYSCALLS_STD
++ # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
+diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
+index 51e3956..7e09b5e 100644
+--- a/package/ntp/ntp.mk
++++ b/package/ntp/ntp.mk
+@@ -3,7 +3,7 @@
+ # ntp
+ #
+ #############################################################
+-NTP_VERSION = 4.2.6p2
++NTP_VERSION = 4.2.6p3
+ NTP_SOURCE = ntp-$(NTP_VERSION).tar.gz
+ NTP_SITE = http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2
+
+--
+cgit v0.8.2.1
diff --git a/patches/buildroot/2010.11/149c-ntp-add_ntpdate_option_and_make_ntpd_optional.patch b/patches/buildroot/2010.11/149c-ntp-add_ntpdate_option_and_make_ntpd_optional.patch
new file mode 100644
index 0000000..44d5c2e
--- /dev/null
+++ b/patches/buildroot/2010.11/149c-ntp-add_ntpdate_option_and_make_ntpd_optional.patch
@@ -0,0 +1,124 @@
+From 14a971ab6c47324dd1422b1787c393702b2d475c Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gu...@za...>
+Date: Thu, 03 Feb 2011 20:45:57 +0000
+Subject: ntp: add ntpdate option
+
+Closes #2935
+
+Add ntpdate option and make ntpd optional.
+
+Based on incomplete patch by Frederik Pasch <fp...@go...>
+
+Also enable crypto when openssl is enabled.
+
+Signed-off-by: Gustavo Zacarias <gu...@za...>
+Signed-off-by: Peter Korsgaard <ja...@su...>
+---
+diff --git a/package/ntp/Config.in b/package/ntp/Config.in
+index afbf0d5..1b2ab4b 100644
+--- a/package/ntp/Config.in
++++ b/package/ntp/Config.in
+@@ -27,6 +27,22 @@ config BR2_PACKAGE_NTP_NTP_WAIT
+ (synchronized). This could be useful at boot time, to delay the
+ boot sequence until after "ntpd -g" has set the time.
+
++config BR2_PACKAGE_NTP_NTPD
++ bool "ntpd"
++ depends on BR2_PACKAGE_NTP
++ default y
++ help
++ ntpd is the time synchronization daemon keeping your local
++ system date and time in sync and optionally serving time and date
++ information on the network via the NTP protocol.
++
++config BR2_PACKAGE_NTP_NTPDATE
++ bool "ntpdate"
++ depends on BR2_PACKAGE_NTP
++ help
++ The ntpdate utility program is used to set the local date and time
++ from an NTP server given as an argument.
++
+ config BR2_PACKAGE_NTP_NTPDC
+ bool "ntpdc"
+ depends on BR2_PACKAGE_NTP
+diff --git a/package/ntp/TODO b/package/ntp/TODO
+deleted file mode 100644
+index ba6d7fd..0000000
+--- a/package/ntp/TODO
++++ b/dev/null
+@@ -1,33 +0,0 @@
+-The obsolete patch tries to clear "BUILT_SOURCE"
+-
+-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+-***************
+-*** 157,163 ****
+- bin_PROGRAMS = ntpdc
+- EXTRA_PROGRAMS = ntpdc-layout
+- EXTRA_DATA = check-layout
+-- BUILT_SOURCES = maybe-layout
+- INCLUDES = -I$(top_srcdir)/include
+- # LDADD might need RESLIB and ADJLIB
+- ntpdc_LDADD = version.o ../libntp/libntp.a @READLINE_LIBS@
+---- 157,163 ----
+- bin_PROGRAMS = ntpdc
+- EXTRA_PROGRAMS = ntpdc-layout
+- EXTRA_DATA = check-layout
+-+ BUILT_SOURCES =
+- INCLUDES = -I$(top_srcdir)/include
+- # LDADD might need RESLIB and ADJLIB
+- ntpdc_LDADD = version.o ../libntp/libntp.a @READLINE_LIBS@
+-------------------------------------------------------------
+-The current tarball contains a lot more:
+-
+-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+-AUTOMAKE_OPTIONS = ../util/ansi2knr
+-EXTRA_DATA = check-layout
+-BUILT_SOURCES = @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h ntpdc.1 \
+- ntpdc-opts.texi ntpdc-opts.menu
+-AM_CPPFLAGS = -I$(top_srcdir)/include $(LIBOPTS_CFLAGS)
+-# LDADD might need RESLIB and ADJLIB
+-------------------------------------------------------------
+-
+-Do we need to remove "@MAKE_CHECK_LAYOUT@" in a new patch?
+diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
+index 7e09b5e..bca5d6e 100644
+--- a/package/ntp/ntp.mk
++++ b/package/ntp/ntp.mk
+@@ -15,25 +15,32 @@ endif
+
+ NTP_CONF_OPT = --with-shared \
+ --program-transform-name=s,,, \
+- --without-crypto \
+ --disable-tickadj \
+ --without-ntpsnmpd
+
++ifeq ($(BR2_PACKAGE_OPENSSL),y)
++NTP_CONF_OPT += --with-crypto
++NTP_DEPENDENCIES += openssl
++else
++NTP_CONF_OPT += --without-crypto
++endif
++
+ define NTP_PATCH_FIXUPS
+ $(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c
+ $(SED) '/[[:space:](]rindex[[:space:]]*(/s/[[:space:]]*rindex[[:space:]]*(/ strrchr(/g' $(@D)/ntpd/*.c
+ endef
+
+-NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait
++NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace
++NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
+ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
+
+ define NTP_INSTALL_TARGET_CMDS
+- install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd
++ $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
+ test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
+ install -m 755 package/ntp/ntp.sysvinit $(TARGET_DIR)/etc/init.d/S49ntp
+ @if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \
+--
+cgit v0.8.2.1
diff --git a/patches/buildroot/2010.11/149d-ntp-only_install_init_script_if_ntpd_is_enabled.patch b/patches/buildroot/2010.11/149d-ntp-only_install_init_script_if_ntpd_is_enabled.patch
new file mode 100644
index 0000000..2a90097
--- /dev/null
+++ b/patches/buildroot/2010.11/149d-ntp-only_install_init_script_if_ntpd_is_enabled.patch
@@ -0,0 +1,52 @@
+From d0352edeea629349a0ce497e53cb6ce34feacac0 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <ja...@su...>
+Date: Fri, 04 Feb 2011 19:00:35 +0000
+Subject: ntp: only install init script if ntpd is enabled
+
+Further more:
+- Rename to S49ntp to match other packages
+- Fix start target to run ntpd, and only try ntpdate if available
+
+Signed-off-by: Peter Korsgaard <ja...@su...>
+---
+diff --git a/package/ntp/ntp.sysvinit b/package/ntp/S49ntp
+index 38e60b0..7b929e9 100755
+--- a/package/ntp/ntp.sysvinit
++++ b/package/ntp/S49ntp
+@@ -20,16 +20,15 @@ fi
+
+ case "$1" in
+ start)
+- if test x$NTPDATE = xyes ; then
++ if [ -x $NTPDATE_BIN ] ; then
+ echo -n "Getting initial time via ntp"
+ $NTPDATE_BIN $NTPDATE_OPTS $NTPSERVERS > /dev/null 2>&1
+ echo "."
+ fi
+- if test x$NTPD = xyes ; then
+- echo -n "Starting $DESC: $NAME"
+- start-stop-daemon -S -q -x $DAEMON
+- echo "."
+- fi
++
++ echo -n "Starting $DESC: $NAME"
++ start-stop-daemon -S -q -x $DAEMON
++ echo "."
+ ;;
+ stop) echo -n "Stopping $DESC: $NAME"
+ start-stop-daemon -K -q -n $NAME
+diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
+index bca5d6e..72e462e 100644
+--- a/package/ntp/ntp.mk
++++ b/package/ntp/ntp.mk
+@@ -42,7 +42,7 @@ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
+ define NTP_INSTALL_TARGET_CMDS
+ $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
+ test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
+- install -m 755 package/ntp/ntp.sysvinit $(TARGET_DIR)/etc/init.d/S49ntp
++ $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp)
+ @if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \
+ install -m 755 -d $(TARGET_DIR)/etc/default ; \
+ install -m 644 package/ntp/ntpd.etc.default $(TARGET_DIR)/etc/default/ntpd ; \
+--
+cgit v0.8.2.1
diff --git a/target/linux/modules/fpga/dev_tools/loader/Makefile b/target/linux/modules/fpga/dev_tools/loader/Makefile
index 422fcc1..882f307 100644
--- a/target/linux/modules/fpga/dev_tools/loader/Makefile
+++ b/target/linux/modules/fpga/dev_tools/loader/Makefile
@@ -25,7 +25,7 @@ KDIR := $(ARMADEUS_LINUX_DIR)
PWD := $(shell pwd)
# Armadeus custom drivers common targets (default, clean, etc...)
-include ../Makefile.in
+include ../../../Makefile.in
endif
diff --git a/target/linux/modules/fpga/dev_tools/loader/load_fpga b/target/linux/modules/fpga/dev_tools/loader/load_fpga
index b31278e..5ee1350 100755
--- a/target/linux/modules/fpga/dev_tools/loader/load_fpga
+++ b/target/linux/modules/fpga/dev_tools/loader/load_fpga
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# Loads APFxx's FPGA by using fpgaloader driver
+#
if [ "$1" == "" ] || [ ! -f "$1" ]; then
echo "Usage: `basename $0` <filename>"
@@ -24,7 +27,25 @@ while [ ! -c /dev/fpgaloader ]; do
fi
done
-dd if=$1 of=/dev/fpgaloader
+PLATFORM=`cat /etc/machine`
+if [ "$PLATFORM" == "APF51" ]; then
+ # On APF51 FPGA loading shares NAND bus so it's safer to load
+ # firmware from RAM
+ BITFILE=/tmp/tmp_bitfile
+ cp $1 $BITFILE
+ if [ "$?" != 0 ]; then
+ echo "Error while making bitfile copy in RAM !"
+ exit 1
+ fi
+else
+ BITFILE=$1
+fi
+
+dd if=$BITFILE of=/dev/fpgaloader
+
+if [ "$PLATFORM" == "APF51" ]; then
+ rm $BITFILE # delete copy in RAM
+fi
exit 0
diff --git a/target/test/test_adc.sh b/target/test/test_adc.sh
index b20de49..495be82 100755
--- a/target/test/test_adc.sh
+++ b/target/test/test_adc.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -15,44 +15,84 @@ source ./test_helpers.sh
source ./test_env.sh
-test_setup_apf9328()
+test_setup()
{
- ask_user "Please connect EOC (ADC pin 11 & CSI pin 12) and CVNST (ADC pin 10 & CSI pin 9), then press ENTER"
- ADC_SPI_SYS="/sys/bus/spi/devices/spi1.0"
+ if [ "$1" == "APF9328" ]; then
+ ask_user "Please connect EOC (ADC pin 11 & CSI pin 12) and CVNST (ADC pin 10 & CSI pin 9), then press ENTER"
+ modprobe max1027
+ ADC_SPI_SYS="/sys/bus/spi/devices/spi1.0"
+ elif [ "$1" == "APF27" ]; then
+ modprobe max1027
+ ADC_SPI_SYS="/sys/bus/spi/devices/spi0.0"
+ elif [ "$1" == "APF51" ]; then
+ modprobe hwmon
+ modprobe as1531
+ else
+ echo "Platform not supported by this test"
+ fi
+ return $?
}
-test_setup_apf27()
+test_running_max1027()
{
- ADC_SPI_SYS="/sys/bus/spi/devices/spi0.0"
+ # Slow mode
+ let set=0x62; echo $set > $ADC_SPI_SYS/setup
+ let conv=0xf9; echo $conv > $ADC_SPI_SYS/conversion
+ echo "WAIT" > /dev/null
+ temp=`cat $ADC_SPI_SYS/temp1_input`
+ AIN0=`cat $ADC_SPI_SYS/in0_input`
+ if [ "$temp" != "0" ] && [ "$AIN0" != "0" ]; then
+ echo "Temp: $temp m°C"
+ echo "AIN0: $AIN0"
+ else
+ exit_failed
+ fi
+ # Fast mode
+ loadmax.sh
+ let set=0xb1; echo $set > $ADC_SPI_SYS/conversion
+ sleep 1
+ let set=0x48; echo $set > $ADC_SPI_SYS/setup
+ let set=0x20; echo $set > $ADC_SPI_SYS/averaging
+ echo "Reading in fast mode:"
+ dd if=/dev/max1027/AIN0 bs=2 count=10 | hexdump
+}
+
+test_running_as1531()
+{
+ ask_user "Connect (jumper) pin 11 (AIN1) and 13 (GND) of ADC connector, then press ENTER"
+ VALUE=`cat /sys/bus/spi/devices/spi0.0/in1_input`
+ if [ "$VALUE" -gt 3 ]; then
+ exit_failed
+ fi
+ ask_user "Connect (jumper) pin 5 (REF) and 6 (AIN6) of ADC connector, then press ENTER"
+ VALUE=`cat /sys/bus/spi/devices/spi0.0/in6_input`
+ if [ "$VALUE" -lt 2497 ]; then
+ exit_failed
+ fi
+ return 0
+}
+
+test_running()
+{
+ if [ "$1" == "APF9328" ]; then
+ test_running_max1027
+ elif [ "$1" == "APF27" ]; then
+ test_running_max1027
+ elif [ "$1" == "APF51" ]; then
+ test_running_as1531
+ else
+ echo "Platform not supported by this test"
+ fi
+ return $?
}
test_ADC()
{
show_test_banner "ADC"
- modprobe max1027
+ execute_for_target test_setup
if [ "$?" == 0 ]; then
- execute_for_target test_setup_apf9328 test_setup_apf27
- # Slow mode
- let set=0x62; echo $set > $ADC_SPI_SYS/setup
- let conv=0xf9; echo $conv > $ADC_SPI_SYS/conversion
- echo "WAIT" > /dev/null
- temp=`cat $ADC_SPI_SYS/temp1_input`
- AIN0=`cat $ADC_SPI_SYS/in0_input`
- if [ "$temp" != "0" ] && [ "$AIN0" != "0" ]; then
- echo "Temp: $temp m°C"
- echo "AIN0: $AIN0"
- else
- exit_failed
- fi
- # Fast mode
- loadmax.sh
- let set=0xb1; echo $set > $ADC_SPI_SYS/conversion
- sleep 1
- let set=0x48; echo $set > $ADC_SPI_SYS/setup
- let set=0x20; echo $set > $ADC_SPI_SYS/averaging
- echo "Reading in fast mode:"
- dd if=/dev/max1027/AIN0 bs=2 count=10 | hexdump
+ execute_for_target test_running
if [ "$?" == 0 ]; then
echo_test_ok
else
diff --git a/target/test/test_audio.sh b/target/test/test_audio.sh
index dbc0c21..6b85973 100755
--- a/target/test/test_audio.sh
+++ b/target/test/test_audio.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -16,22 +16,54 @@ source ./test_env.sh
TEMP_FILE=/tmp/toto.wav
-end_of_test_for_apf9328()
+test_init()
{
- echo_test_ok
- exit 0
+ if [ "$1" == "APF9328" ]; then
+ modprobe snd-imx-alsa-tsc2102
+ elif [ "$1" == "APF27" ]; then
+ modprobe snd-imx-alsa-tsc2102
+ elif [ "$1" == "APF51" ]; then
+ modprobe snd-soc-imx-fiq
+ modprobe snd-soc-wm8960
+ modprobe snd-soc-apf51dev-wm8960
+ amixer cset numid=40 on
+ amixer cset numid=37 on
+ else
+ echo "Platform not supported by this test"
+ fi
+}
+
+end_of_test_for_apf9328_and_continue_for_others()
+{
+ if [ "$1" == "APF9328" ]; then
+ echo_test_ok
+ exit 0
+ elif [ "$1" == "APF27" ]; then
+ true
+ elif [ "$1" == "APF51" ]; then
+ true
+ else
+ echo "Platform not supported by this test"
+ fi
}
-continue_for_apf27()
+test_audio_in_init()
{
- true
+ if [ "$1" == "APF27" ]; then
+ amixer cset numid=7 on
+ amixer cset numid=6 30
+ elif [ "$1" == "APF51" ]; then
+ echo
+ else
+ echo "Platform not supported by this test"
+ fi
}
test_audio()
{
show_test_banner "Sound / ALSA"
- modprobe snd-imx-alsa-tsc2102
+ execute_for_target test_init
if [ "$?" != 0 ]; then
exit_failed
fi
@@ -52,11 +84,10 @@ test_audio()
fi
fi
- execute_for_target end_of_test_for_apf9328 continue_for_apf27
+ execute_for_target end_of_test_for_apf9328_and_continue_for_others
ask_user "Please connect a microphone to the Audio In connector (bottom one on APF27). Then press ENTER."
- amixer cset numid=7 on
- amixer cset numid=6 30
+ execute_for_target test_audio_in_init
ask_user "You will now have to speak in the MIC. The sampled sound will then be played back. Press ENTER when ready to speak."
# Stereo 16bits @ 16KHz
arecord -r 16000 -f S16_LE -c 2 $TEMP_FILE & pid=$!
diff --git a/target/test/test_backlight.sh b/target/test/test_backlight.sh
index 6590b37..095b201 100755
--- a/target/test/test_backlight.sh
+++ b/target/test/test_backlight.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008-2010 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -15,6 +15,18 @@ source ./test_helpers.sh
SYS_DIR=/sys/class/backlight/imx-bl
+load_driver()
+{
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ modprobe imx_bl
+ elif [ "$1" == "APF51" ]; then
+ echo "Not supported yet"
+ exit 0
+ else
+ echo "Platform not supported by this test"
+ fi
+}
+
test_backlight()
{
show_test_banner "Backlight"
@@ -23,10 +35,10 @@ test_backlight()
clear > /dev/tty1
cat /dev/zero | tr '\0' '\377' | dd of=/dev/fb0 bs=1K count=750 2>/dev/null
- modprobe imx_bl
+ execute_for_target load_driver
if [ "$?" != 0 ]; then
echo "module not found"
- exit 1
+ exit_failed
fi
current=`cat $SYS_DIR/actual_brightness`
echo "Current brightness level: $current / 256"
diff --git a/target/test/test_bluetooth.sh b/target/test/test_bluetooth.sh
index 0c9b3b7..bb72bdb 100755
--- a/target/test/test_bluetooth.sh
+++ b/target/test/test_bluetooth.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2010 The Armadeus Project
+# Copyright (C) 2010-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -14,27 +14,42 @@
source ./test_helpers.sh
#source ./test_env.sh
+attach_bt_chip()
+{
+ if [ "$1" == "APF27" ]; then
+ /usr/sbin/hciattach -s 921600 ttySMX5 csr 921600
+ elif [ "$1" == "APF51" ]; then
+ /usr/sbin/hciattach -s 921600 ttymxc1 csr 921600
+ else
+ echo "Platform not supported by this test"
+ fi
+}
+
test_bluetooth()
{
show_test_banner "Bluetooth"
- modprobe btusb
- if [ "$?" != 0 ]; then
- echo "Unable to launch USB<->Bluetooth layer !!"
- exit_failed
+ ask_user "Do you want to test USB or board integrated Bluetooth ? (u/I)"
+ if [ "$response" == "u" ]; then
+ modprobe btusb
+ if [ "$?" != 0 ]; then
+ echo "Unable to launch USB<->Bluetooth layer !!"
+ exit_failed
+ fi
+ ask_user "Please insert your USB dongle, then press ENTER"
+ else
+ execute_for_target attach_bt_chip
fi
- ask_user "Please insert your USB dongle, then press ENTER"
-
hciconfig hci0 up piscan
sleep 1
hciconfig
- ask_user "Do you see your dongle ? (Y/n)"
+ ask_user "Do you see your Bluetooth interface ? (Y/n)"
if [ "$response" == "n" ] || [ "$response" == "no" ]; then
exit_failed
fi
- ask_user "Be sure that your Host has its Bluetooth interface up and running (hciconfig hci0 up piscan), then press ENTER"
+ ask_user "Be sure that your Host PC has its Bluetooth interface up and running (hciconfig hci0 up piscan), then press ENTER"
MY_BTADDR=`hcitool dev | grep hci0 | cut -f 3`
if [ "$MY_BTADDR" == "" ]; then
diff --git a/target/test/test_dac.sh b/target/test/test_dac.sh
index fac0370..068f7b2 100755
--- a/target/test/test_dac.sh
+++ b/target/test/test_dac.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -12,23 +12,41 @@
#
source ./test_helpers.sh
-source ./test_env.sh
+#source ./test_env.sh
+do_test()
+{
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ setDAC AB 500
+ if [ "$?" == 0 ]; then
+ sleep 2
+ setDAC AB 0
+ echo_test_ok
+ else
+ echo "Hardware not found !"
+ fi
+ elif [ "$1" == "APF51" ]; then
+ modprobe mcp49x2
+ cd /sys/bus/spi/devices/spi0.1/device0
+ ls
+ echo 500 > out0_raw
+ echo 500 > out1_raw
+ sleep 2
+ echo 0 > out0_raw
+ echo 0 > out1_raw
+ echo_test_ok
+ else
+ echo "Platform not supported by this test"
+ fi
+}
test_DAC()
{
show_test_banner "DAC"
- ask_user "This test is more probant with vumeters. Press ENTER."
+ ask_user "This test is more probant with vumeters. Connect them and press ENTER."
- setDAC AB 500
- if [ "$?" == 0 ]; then
- sleep 2
- setDAC AB 0
- echo_test_ok
- else
- echo "Hardware not found !"
- fi
+ execute_for_target do_test
}
test_DAC
diff --git a/target/test/test_fpga.sh b/target/test/test_fpga.sh
index 3a7dc1f..c351b45 100755
--- a/target/test/test_fpga.sh
+++ b/target/test/test_fpga.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -15,38 +15,47 @@ source ./test_helpers.sh
source ./test_env.sh
-load_led_apf9328()
+load_led()
{
- load_fpga ./data/fpga/blinking_led_apf9328_200k.bit
- RES=$?
-}
-
-load_led_apf27()
-{
- ask_user "Please connect pins 1 & 39 of J20 connector (3,3V supply for FPGA bank)\nThen press enter"
- load_fpga ./data/fpga/blinking_led_apf27_200k.bit
- RES=$?
-}
-
-load_button_apf9328()
-{
- load_fpga ./data/fpga/wishbone_example_apf9328_200k.bit
- RES=$?
+ if [ "$1" == "APF9328" ]; then
+ load_fpga ./data/fpga/blinking_led_apf9328_200k.bit
+ RES=$?
+ elif [ "$1" == "APF27" ]; then
+ ask_user "Please connect pins 1 & 39 of J20 connector (3,3V supply for FPGA bank)\nThen press enter"
+ load_fpga ./data/fpga/blinking_led_apf27_200k.bit
+ RES=$?
+ elif [ "$1" == "APF51" ]; then
+ ask_user "Please power on FPGA bank XXX\nThen press enter"
+ load_fpga ./data/fpga/blinking_led_apf51.bit
+ RES=$?
+ else
+ echo "Platform not supported by this test"
+ fi
}
-load_button_apf27()
+load_button()
{
- echo "I hope you have connected pins 1 & 39 of J20"
- load_fpga ./data/fpga/wishbone_example_apf27_200k.bit
- RES=$?
+ if [ "$1" == "APF9328" ]; then
+ load_fpga ./data/fpga/wishbone_example_apf9328_200k.bit
+ RES=$?
+ elif [ "$1" == "APF27" ]; then
+ echo "I hope you have connected pins 1 & 39 of J20"
+ load_fpga ./data/fpga/wishbone_example_apf27_200k.bit
+ RES=$?
+ elif [ "$1" == "APF51" ]; then
+ echo "I hope you have powered up Bank XXX"
+ load_fpga ./data/fpga/wishbone_example_apf51.bit
+ RES=$?
+ else
+ echo "Platform not supported by this test"
+ fi
}
-
test_fpga_load()
{
show_test_banner "FPGA loading"
- execute_for_target load_led_apf9328 load_led_apf27
+ execute_for_target load_led
if [ "$RES" == 0 ]; then
ask_user "Did you see the FPGA's LED blinking ? (y/N)"
@@ -62,7 +71,7 @@ test_fpga_it()
{
show_test_banner "FPGA interrupts"
- execute_for_target load_button_apf9328 load_button_apf27
+ execute_for_target load_button
if [ "$RES" != 0 ]; then
exit_failed
fi
diff --git a/target/test/test_gpio.sh b/target/test/test_gpio.sh
index f7497c5..49798dc 100755
--- a/target/test/test_gpio.sh
+++ b/target/test/test_gpio.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008-2009 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -14,69 +14,105 @@
source ./test_helpers.sh
source /usr/bin/gpio_helpers.sh
-
-blink_led_apf27()
+load_module()
{
- LED_NAME="D14"
- gpio_mode PF14 1
- for i in `seq 0 5`; do
- gpio_set_value PF14 0
- usleep 500000
- gpio_set_value PF14 1
- usleep 500000
- done
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ loadgpio.sh
+ if [ "$?" != 0 ] || [ ! -c "$GPIO_DEV_DIR/portA" ]; then
+ echo "Module failed to load"
+ exit_failed
+ fi
+ elif [ "$1" == "APF51" ]; then
+ echo
+ else
+ echo "Platform not supported by this test"
+ fi
}
-blink_led_apf9328()
+unload_module()
{
- LED_NAME="a"
- gpio_mode PD31 1
- for i in `seq 0 5`; do
- gpio_set_value PD31 1
- usleep 500000
- gpio_set_value PD31 0
- usleep 500000
- done
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ rmmod gpio
+ elif [ "$1" == "APF51" ]; then
+ echo
+ else
+ echo "Platform not supported by this test"
+ fi
}
-check_button_apf27()
+blink_led()
{
- gpio_mode PF13 0 # input
- setbit /proc/driver/gpio/portFirq 13 1
- echo "Press 2 times on S1 button"
- /usr/bin/testsuite/testbutton /dev/gpio/PF13 3
- if [ "$?" != 0 ]; then
- exit_failed
+ if [ "$1" == "APF9328" ]; then
+ LED_NAME="a"
+ gpio_mode PD31 1
+ for i in `seq 0 5`; do
+ gpio_set_value PD31 1
+ usleep 500000
+ gpio_set_value PD31 0
+ usleep 500000
+ done
+ elif [ "$1" == "APF27" ]; then
+ LED_NAME="D14"
+ gpio_mode PF14 1
+ for i in `seq 0 5`; do
+ gpio_set_value PF14 0
+ usleep 500000
+ gpio_set_value PF14 1
+ usleep 500000
+ done
+ elif [ "$1" == "APF51" ]; then
+ LED="2"
+ echo $LED > /sys/class/gpio/export
+ ls /sys/class/gpio/gpio$LED/
+ echo out > /sys/class/gpio/gpio$LED/direction
+ for i in `seq 0 5`; do
+ echo 1 > /sys/class/gpio/gpio$LED/value
+ usleep 500000
+ echo 0 > /sys/class/gpio/gpio$LED/value
+ usleep 500000
+ done
+ else
+ echo "Platform not supported by this test"
fi
}
-check_button_apf9328()
+check_button()
{
- echo "TBDL"
-}
+ if [ "$1" == "APF9328" ]; then
+ echo "TBDL"
+ elif [ "$1" == "APF27" ]; then
+ gpio_mode PF13 0 # input
+ setbit /proc/driver/gpio/portFirq 13 1
+ echo "Press 2 times on S1 button"
+ /usr/bin/testsuite/testbutton /dev/gpio/PF13 3
+ if [ "$?" != 0 ]; then
+ exit_failed
+ fi
+ elif [ "$1" == "APF51" ]; then
+ echo "TBDL"
+ else
+ echo "Platform not supported by this test"
+ fi
+}
test_led_gpio()
{
show_test_banner "GPIO (LED)"
- loadgpio.sh
- if [ "$?" != 0 ] || [ ! -c "$GPIO_DEV_DIR/portA" ]; then
- echo "Module failed to load"
- exit_failed
- fi
+ execute_for_target load_module
ask_user "I will now blink a LED on your board. Press ENTER to continue"
- execute_for_target blink_led_apf9328 blink_led_apf27
+ execute_for_target blink_led
ask_user "Did you see "$LED_NAME" LED blinking ? (y/N)"
if [ "$response" != "y" ] && [ "$response" != "yes" ]; then
exit_failed
fi
- execute_for_target check_button_apf9328 check_button_apf27
+ execute_for_target check_button
- rmmod gpio
+ execute_for_target unload_module
echo_test_ok
exit 0
}
diff --git a/target/test/test_helpers.sh b/target/test/test_helpers.sh
index 4cce91a..2f524ae 100644
--- a/target/test/test_helpers.sh
+++ b/target/test/test_helpers.sh
@@ -141,12 +141,15 @@ wake_up_lcd()
execute_for_target()
{
BOARD=`cat /etc/machine`
- if [ "$BOARD" == "APF9328" ] && [ "$1" != "" ]; then
- $1
- fi
- if [ "$BOARD" == "APF27" ] && [ "$2" != "" ]; then
- $2
- fi
+ if [ "$1" != "" ]; then
+ if [ "$BOARD" == "APF9328" ]; then
+ $1 $BOARD
+ elif [ "$BOARD" == "APF27" ]; then
+ $1 $BOARD
+ elif [ "$BOARD" == "APF51" ]; then
+ $1 $BOARD
+ fi
+ fi
}
# $1: name of the file in $TEMP_DIR
diff --git a/target/test/test_pwm.sh b/target/test/test_pwm.sh
index 1f72d99..23d957a 100755
--- a/target/test/test_pwm.sh
+++ b/target/test/test_pwm.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2010 The Armadeus Project
+# Copyright (C) 2010-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -25,28 +25,41 @@ FREQUENCY="100 200 300 400 500 600 700 800"
DUTY="001 250 333 500 666 750 999"
SLEEP_TIME=4
-
-prepare_test_for_apf9328()
+load_driver()
{
- ask_user "Please connect your oscilloscope probe to pin 4 of X21/Timer connector (GND is on pin 8), then press ENTER when ready"
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ modprobe imx-pwm
+ if [ ! -d "$SYS_DIR" ]; then
+ echo "can't find /sys/ interface"
+ exit_failed
+ fi
+ elif [ "$1" == "APF51" ]; then
+ echo "TBDL"
+ else
+ echo "Platform not supported by this test"
+ fi
}
-prepare_test_for_apf27()
+prepare_test()
{
- ask_user "Please connect your oscilloscope probe to pin 4 of J22 connector (GND is on pin 6 or 40), then press ENTER when ready"
+ if [ "$1" == "APF9328" ]; then
+ ask_user "Please connect your oscilloscope probe to pin 4 of X21/Timer connector (GND is on pin 8), then press ENTER when ready"
+ elif [ "$1" == "APF27" ]; then
+ ask_user "Please connect your oscilloscope probe to pin 4 of J22 connector (GND is on pin 6 or 40), then press ENTER when ready"
+ elif [ "$1" == "APF51" ]; then
+ ask_user "Please connect your oscilloscope probe to pin 6 of J35 (Extension) connector (GND is on pin 9 or 10), then press ENTER when ready"
+ else
+ echo "Platform not supported by this test"
+ fi
}
test_pwm()
{
show_test_banner "PWM"
- modprobe imx-pwm
- if [ ! -d "$SYS_DIR" ]; then
- echo "can't find /sys/ interface"
- exit_failed
- fi
+ execute_for_target load_driver
- execute_for_target prepare_test_for_apf9328 prepare_test_for_apf27
+ execute_for_target prepare_test
ask_user "Press ENTER when ready to check PWM output (frequencies starting at 100Hz)"
echo 1 > $SYS_DIR/active
diff --git a/target/test/test_rs232.sh b/target/test/test_rs232.sh
index 016061a..059cdfe 100755
--- a/target/test/test_rs232.sh
+++ b/target/test/test_rs232.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -15,27 +15,30 @@ source ./test_helpers.sh
source ./test_env.sh
-echo_jumper_help_apf9328()
+echo_jumper_help()
{
- echo " (Pin 1 & 3 of UART connector)"
-}
-
-echo_jumper_help_apf27()
-{
- echo " (Pin 2 & 3 of J21 connector (between RS and J8))"
+ if [ "$1" == "APF9328" ]; then
+ echo " (Pin 1 & 3 of UART connector)"
+ elif [ "$1" == "APF27" ]; then
+ echo " (Pin 2 & 3 of J21 connector (between RS and J8))"
+ elif [ "$1" == "APF51" ]; then
+ echo " (Pin 2 & 3 of RS-232 connector)"
+ else
+ echo "Platform not supported by this test"
+ fi
}
test_serial_port()
{
show_test_banner "Serial port $1"
- SERIAL_DEVICE="/dev/ttySMX$1"
+ SERIAL_DEVICE="$SERIAL_DEVICES$1"
TEMP_FILE="/tmp/serial_test$1"
echo "$SERIAL_DEVICE"
stty -F $SERIAL_DEVICE -echo
if [ "$?" == 0 ]; then
echo -n "Connect loopback jumper"
- execute_for_target echo_jumper_help_apf9328 echo_jumper_help_apf27
+ execute_for_target echo_jumper_help
ask_user "and then press <ENTER>"
# Configure port as raw
stty -F $SERIAL_DEVICE raw
@@ -61,22 +64,28 @@ test_serial_port()
fi
}
-echo_apf9328_ports()
+echo_available_ports()
{
- echo " Available one: [ 1 ]"
-}
-
-echo_apf27_ports()
-{
- echo " Available one: [ 2 ]"
+ if [ "$1" == "APF9328" ]; then
+ echo " Available one: [ 1 ]"
+ SERIAL_DEVICES="/dev/ttySMX"
+ elif [ "$1" == "APF27" ]; then
+ echo " Available one: [ 2 ]"
+ SERIAL_DEVICES="/dev/ttySMX"
+ elif [ "$1" == "APF51" ]; then
+ echo " Available one: [ 0 ]"
+ SERIAL_DEVICES="/dev/ttymxc"
+ else
+ echo "Platform not supported by this test"
+ fi
}
show_test_banner "Serial ports"
PORT="$1"
if [ "$1" == "" ]; then
echo "Please give the port number to test !"
- execute_for_target echo_apf9328_ports echo_apf27_ports
- read PORT
+ execute_for_target echo_available_ports
+ read -p "> " PORT
[ "$PORT" == "" ] && exit_failed
fi
diff --git a/target/test/test_touchscreen.sh b/target/test/test_touchscreen.sh
index 42d35f6..6ad0015 100755
--- a/target/test/test_touchscreen.sh
+++ b/target/test/test_touchscreen.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -14,16 +14,29 @@
source ./test_helpers.sh
source ./test_env.sh
+load_driver()
+{
+ if [ "$1" == "APF9328" ] || [ "$1" == "APF27" ]; then
+ modprobe tsc2102_ts
+ sleep 1
+ dmesg | tail | grep "TSC210x Touchscreen driver initialized"
+ RES="$?"
+ elif [ "$1" == "APF51" ]; then
+ modprobe wm831x-ts
+ dmesg | tail | grep WM831x
+ RES="$?"
+ else
+ echo "Platform not supported by this test"
+ fi
+}
test_touchscreen()
{
show_test_banner "Touchscreen"
- modprobe tsc2102_ts
- sleep 1
+ execute_for_target load_driver
- dmesg | tail | grep "TSC210x Touchscreen driver initialized"
- if [ "$?" != 0 ]; then
+ if [ "$RES" != 0 ]; then
echo "Hardware not found !"
exit_failed
fi
diff --git a/target/test/test_usb_device.sh b/target/test/test_usb_device.sh
index 69267d5..1a46107 100755
--- a/target/test/test_usb_device.sh
+++ b/target/test/test_usb_device.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -14,11 +14,28 @@
source ./test_helpers.sh
source ./test_env.sh
+check_driver()
+{
+ if [ "$1" == "APF9328" ]; then
+ dmesg | grep "imx_udc"
+ STORAGE_DRIVER=g_file_storage
+ elif [ "$1" == "APF27" ]; then
+ echo "APF27 do not support USB device mode"
+ exit 0
+ elif [ "$1" == "APF51" ]; then
+ dmesg | grep "USB" | grep "Device"
+ STORAGE_DRIVER=g_mass_storage
+ else
+ echo "Platform not supported by this test"
+ fi
+
+}
+
test_usb_gadget()
{
show_test_banner "USB gadget"
BACKING_FILE="/tmp/backing_file.gz"
- dmesg | grep "imx_udc"
+ execute_for_target check_driver
if [ "$?" == 0 ]; then
udhcpc -i eth0
echo "Downloading test file from Internet"
@@ -27,12 +44,13 @@ test_usb_gadget()
exit_failed
fi
gunzip $BACKING_FILE
- modprobe g_file_storage file=/tmp/backing_file
+ modprobe $STORAGE_DRIVER file=/tmp/backing_file
sleep 1
ask_user "Please connect your board to your PC with a USB cable and see if a mass storage\ndevice is detected. Try to open the image inside the device.\n Do you see something interesting ? ;-) (y/N)"
test_result=$response
+
ask_user "Please unmount mass storage device of your PC, unplug USB cable and then press ENTER"
- rmmod g_file_storage
+ rmmod $STORAGE_DRIVER
rm /tmp/backing_file
if [ "$test_result" == "y" ] || [ "$test_result" == "yes" ]; then
echo_test_ok
diff --git a/target/test/test_usb_host.sh b/target/test/test_usb_host.sh
index ac1ffaf..0ff3231 100755
--- a/target/test/test_usb_host.sh
+++ b/target/test/test_usb_host.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
diff --git a/target/test/test_watchdog.sh b/target/test/test_watchdog.sh
index 92f5c38..51f0208 100755
--- a/target/test/test_watchdog.sh
+++ b/target/test/test_watchdog.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2008 The Armadeus Project
+# Copyright (C) 2008-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -17,6 +17,21 @@ source ./test_env.sh
WATCHDOG_DEV="/dev/watchdog"
SEC=5
+load_driver()
+{
+ if [ "$1" == "APF9328" ]; then
+ modprobe imx-wdt timeout=$SEC
+ RES=$?
+ sleep 1
+ elif [ "$1" == "APF27" ] || [ "$1" == "APF51" ]; then
+ modprobe imx2_wdt timeout=$SEC
+ RES=$?
+ sleep 1
+ else
+ echo "Platform not supported by this test"
+ fi
+}
+
test_watchdog()
{
show_test_banner "Watchdog"
@@ -26,9 +41,7 @@ test_watchdog()
exit_failed
fi
- modprobe imx-wdt timeout=$SEC
- RES=$?
- sleep 1
+ execute_for_target load_driver
if [ "$RES" != 0 ] || [ ! -c "$WATCHDOG_DEV" ] ; then
echo "Module failed to load"
exit_failed
diff --git a/target/test/test_wifi.sh b/target/test/test_wifi.sh
index 3f2a2c9..c55f8f7 100755
--- a/target/test/test_wifi.sh
+++ b/target/test/test_wifi.sh
@@ -3,7 +3,7 @@
#
# Script to test Armadeus Software release
#
-# Copyright (C) 2010 The Armadeus Project
+# Copyright (C) 2010-2011 The Armadeus Project - ARMadeus Systems
#
# 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
@@ -14,12 +14,22 @@
source ./test_helpers.sh
source ./test_env.sh
-TEMP_FILE=/tmp/toto.wav
AP_LIST_FILE=/tmp/ap.list
DEFAULT_WEP_KEY="01234567890123456789012345"
FILE_TO_LOAD="test_wifi.bin"
#SERVER_IP set in test_env.sh
+get_interface_name()
+{
+ if [ "$1" == "APF27" ]; then
+ WLAN_IF=eth1
+ elif [ "$1" == "APF51" ]; then
+ WLAN_IF=wlan0
+ else
+ echo "Platform not supported by this test"
+ exit 0
+ fi
+}
test_wifi()
{
@@ -27,9 +37,9 @@ test_wifi()
ask_user "This test assumes that you run a private WiFi network (WEP shared key security). Your Access Point (AP) should be connected to your Host. Press ENTER to continue"
- ask_user "Do you have an APW wireless extension board ? (Y/n)"
+ ask_user "Do you have an APW wireless extension board or an APF51Dev ? (Y/n)"
if [ "$response" == "n" ] || [ "$response" == "no" ]; then
- echo "Only the APW is supported by this test yet !!"
+ echo "Currently, only the APW & the APF51Dev are supported by this test !!"
exit_failed
fi
@@ -38,7 +48,8 @@ test_wifi()
echo "Failed to load Libertas driver !!"
exit_failed
fi
- ifconfig eth1 up
+ execute_for_target get_interface_name
+ ifconfig $WLAN_IF up
if [ "$?" != 0 ]; then
echo "WLAN interface not available !!"
exit_failed
@@ -47,7 +58,7 @@ test_wifi()
# get available APs (remove hidden one)
echo -e "\n Scanning available APs"
- iwlist eth1 scan | grep ESSID > $AP_LIST_FILE
+ iwlist $WLAN_IF scan | grep ESSID > $AP_LIST_FILE
AP_LIST=`cat $AP_LIST_FILE | grep -v \"\" | cut -d : -f 2 | sed -e 's/"//g'`
# ask which one to use
@@ -61,16 +72,16 @@ test_wifi()
WEP_KEY=$response
fi
echo "Trying to get associated with $AP (key=$WEP_KEY)"
- iwconfig eth1 key $WEP_KEY
- iwconfig eth1 essid $AP
+ iwconfig $WLAN_IF key $WEP_KEY
+ iwconfig $WLAN_IF essid $AP
sleep 3
- associated=`iwconfig eth1 | grep "Access Point" | grep -c -v "Not-Associated"`
+ associated=`iwconfig $WLAN_IF | grep "Access Point" | grep -c -v "Not-Associated"`
if [ "$associated" != 1 ]; then
echo "Failed to get associated with $AP"
exit_failed
fi
echo -e "\n Asking for an IP address"
- udhcpc -i eth1
+ udhcpc -i $WLAN_IF
ask_user "I will now download $FILE_TO_LOAD from your TFTP server ($SERVER_IP).\nBe sure that the file and its correspondig md5sum is available. Then press ENTER."
echo -e "\n Pinging server:"
ping -c 3 $SERVER_IP
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-05-04 09:25:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via b55dff83c825c9461cbafeda422bb426c4984767 (commit)
from aecda1819c08d547c292eabfe9dd33b4abf3e08b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b55dff83c825c9461cbafeda422bb426c4984767
Author: Jeremie Scheer <jer...@ar...>
Date: Wed May 4 11:25:17 2011 +0200
[LINUX] [2.6.38.1] Export irq_desc symbol for FPGA's irq manager in patch 199.
-----------------------------------------------------------------------
Summary of changes:
...nel_to_export_some_irq_handling_functions.patch | 24 +++++++++++++++-----
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
index 46b889d..2d4de9b 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/199-armadeus-hack_kernel_to_export_some_irq_handling_functions.patch
@@ -4,8 +4,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38.1/kernel/irq/chip.c
===================================================================
---- linux-2.6.38.1.orig/kernel/irq/chip.c 2011-04-18 20:43:15.000000000 +0200
-+++ linux-2.6.38.1/kernel/irq/chip.c 2011-04-18 20:46:11.000000000 +0200
+--- linux-2.6.38.1.orig/kernel/irq/chip.c 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/kernel/irq/chip.c 2011-05-04 11:05:47.000000000 +0200
@@ -663,6 +663,7 @@
out_unlock:
raw_spin_unlock(&desc->lock);
@@ -24,8 +24,8 @@ Index: linux-2.6.38.1/kernel/irq/chip.c
set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
Index: linux-2.6.38.1/arch/arm/kernel/irq.c
===================================================================
---- linux-2.6.38.1.orig/arch/arm/kernel/irq.c 2011-04-18 20:48:25.000000000 +0200
-+++ linux-2.6.38.1/arch/arm/kernel/irq.c 2011-04-18 20:48:56.000000000 +0200
+--- linux-2.6.38.1.orig/arch/arm/kernel/irq.c 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/arch/arm/kernel/irq.c 2011-05-04 11:05:47.000000000 +0200
@@ -163,6 +163,7 @@
desc->status &= ~IRQ_NOAUTOEN;
raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -36,8 +36,8 @@ Index: linux-2.6.38.1/arch/arm/kernel/irq.c
{
Index: linux-2.6.38.1/kernel/irq/irqdesc.c
===================================================================
---- linux-2.6.38.1.orig/kernel/irq/irqdesc.c 2011-04-18 21:02:58.000000000 +0200
-+++ linux-2.6.38.1/kernel/irq/irqdesc.c 2011-04-18 21:19:39.000000000 +0200
+--- linux-2.6.38.1.orig/kernel/irq/irqdesc.c 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/kernel/irq/irqdesc.c 2011-05-04 11:05:47.000000000 +0200
@@ -273,6 +273,7 @@
{
return (irq < NR_IRQS) ? irq_desc + irq : NULL;
@@ -46,3 +46,15 @@ Index: linux-2.6.38.1/kernel/irq/irqdesc.c
struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node)
{
+Index: linux-2.6.38.1/include/linux/irqdesc.h
+===================================================================
+--- linux-2.6.38.1.orig/include/linux/irqdesc.h 2011-05-04 11:12:35.000000000 +0200
++++ linux-2.6.38.1/include/linux/irqdesc.h 2011-05-04 11:12:55.000000000 +0200
+@@ -85,6 +85,7 @@
+ #ifndef CONFIG_SPARSE_IRQ
+ extern struct irq_desc irq_desc[NR_IRQS];
+ #endif
++EXPORT_SYMBOL_GPL(irq_desc);
+
+ /* Will be removed once the last users in power and sh are gone */
+ extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-05-03 12:48:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via aecda1819c08d547c292eabfe9dd33b4abf3e08b (commit)
from f73f2ee93f8ea1ca82586dfc0da4f8ec152221a4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aecda1819c08d547c292eabfe9dd33b4abf3e08b
Author: Jeremie Scheer <jer...@ar...>
Date: Tue May 3 14:47:51 2011 +0200
[BUILDROOT] [AS_DEVICES] Add device structure allocation test in C++ wrappers.
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/cpp/as_adc.cpp | 24 ++++++-
target/packages/as_devices/cpp/as_dac.cpp | 23 +++++-
target/packages/as_devices/cpp/as_gpio.cpp | 103 ++++++++++++++++++++++++---
target/packages/as_devices/cpp/as_i2c.cpp | 103 ++++++++++++++++++++++++---
target/packages/as_devices/cpp/as_spi.cpp | 100 ++++++++++++++++++++++++---
5 files changed, 311 insertions(+), 42 deletions(-)
diff --git a/target/packages/as_devices/cpp/as_adc.cpp b/target/packages/as_devices/cpp/as_adc.cpp
index bc23adc..68764ac 100644
--- a/target/packages/as_devices/cpp/as_adc.cpp
+++ b/target/packages/as_devices/cpp/as_adc.cpp
@@ -38,12 +38,20 @@ AsAdc::~AsAdc()
{
int ret;
- ret = as_adc_close(mDev);
- if (ret < 0)
+ if (mDev != NULL)
{
- std::cout<<"AsAdc destruction error"<<std::endl;
+ ret = as_adc_close(mDev);
+ if (ret < 0)
+ {
+ std::cout<<"AsAdc destruction error"<<std::endl;
+ }
+ }
+ else
+ {
+ std::cerr<<"AsAdc device structure not allocated"<<std::endl;
}
}
+
/** @brief get value in millivolts
*
@@ -53,5 +61,13 @@ AsAdc::~AsAdc()
*/
long AsAdc::getValueInMillivolts(int aChannel) const
{
- return as_adc_get_value_in_millivolts(mDev, aChannel);
+ if (mDev != NULL)
+ {
+ return as_adc_get_value_in_millivolts(mDev, aChannel);
+ }
+ else
+ {
+ std::cerr<<"AsAdc device structure not allocated"<<std::endl;
+ return -1;
+ }
}
diff --git a/target/packages/as_devices/cpp/as_dac.cpp b/target/packages/as_devices/cpp/as_dac.cpp
index 1bd5bab..c022e6d 100644
--- a/target/packages/as_devices/cpp/as_dac.cpp
+++ b/target/packages/as_devices/cpp/as_dac.cpp
@@ -40,10 +40,17 @@ AsDac::~AsDac()
{
int ret;
- ret = as_dac_close(mDev);
- if (ret < 0)
+ if (mDev != NULL)
{
- std::cout<<"AsDac destruction error"<<std::endl;
+ ret = as_dac_close(mDev);
+ if (ret < 0)
+ {
+ std::cout<<"AsDac destruction error"<<std::endl;
+ }
+ }
+ else
+ {
+ std::cerr<<"AsDac device structure not allocated"<<std::endl;
}
}
@@ -56,5 +63,13 @@ AsDac::~AsDac()
*/
long AsDac::setValueInMillivolts(int aChannel, int aValue)
{
- return as_dac_set_value_in_millivolts(mDev, aChannel, aValue);
+ if (mDev != NULL)
+ {
+ return as_dac_set_value_in_millivolts(mDev, aChannel, aValue);
+ }
+ else
+ {
+ std::cerr<<"AsDac device structure not allocated"<<std::endl;
+ return -1;
+ }
}
diff --git a/target/packages/as_devices/cpp/as_gpio.cpp b/target/packages/as_devices/cpp/as_gpio.cpp
index 4ca4b3a..e08d883 100644
--- a/target/packages/as_devices/cpp/as_gpio.cpp
+++ b/target/packages/as_devices/cpp/as_gpio.cpp
@@ -37,10 +37,17 @@ AsGpio::~AsGpio()
{
int ret;
- ret = as_gpio_close(mDev);
- if (ret < 0)
+ if (mDev != NULL)
{
- std::cout<<"AsGpio destruction error"<<std::endl;
+ ret = as_gpio_close(mDev);
+ if (ret < 0)
+ {
+ std::cout<<"AsGpio destruction error"<<std::endl;
+ }
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
}
}
@@ -52,7 +59,15 @@ AsGpio::~AsGpio()
*/
long AsGpio::setPinDirection(int aDirection)
{
- return as_gpio_set_pin_direction(mDev, aDirection);
+ if (mDev != NULL)
+ {
+ return as_gpio_set_pin_direction(mDev, aDirection);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get pin direction
@@ -61,7 +76,15 @@ long AsGpio::setPinDirection(int aDirection)
*/
long AsGpio::getPinDirection() const
{
- return as_gpio_get_pin_direction(mDev);
+ if (mDev != NULL)
+ {
+ return as_gpio_get_pin_direction(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Set pin value
@@ -72,7 +95,15 @@ long AsGpio::getPinDirection() const
*/
long AsGpio::setPinValue(int aValue)
{
- return as_gpio_set_pin_value(mDev, aValue);
+ if (mDev != NULL)
+ {
+ return as_gpio_set_pin_value(mDev, aValue);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get pin value
@@ -81,7 +112,15 @@ long AsGpio::setPinValue(int aValue)
*/
long AsGpio::getPinValue() const
{
- return as_gpio_get_pin_value(mDev);
+ if (mDev != NULL)
+ {
+ return as_gpio_get_pin_value(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get pin value, blocking until interrupt occur
@@ -93,7 +132,15 @@ long AsGpio::getPinValue() const
*/
long AsGpio::blockingGetPinValue(int aDelay_s, int aDelay_us) const
{
- return as_gpio_blocking_get_pin_value(mDev, aDelay_s, aDelay_us);
+ if (mDev != NULL)
+ {
+ return as_gpio_blocking_get_pin_value(mDev, aDelay_s, aDelay_us);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Set pin irq mode
@@ -104,7 +151,15 @@ long AsGpio::blockingGetPinValue(int aDelay_s, int aDelay_us) const
*/
long AsGpio::setIrqMode(int aMode)
{
- return as_gpio_set_irq_mode(mDev, aMode);
+ if (mDev != NULL)
+ {
+ return as_gpio_set_irq_mode(mDev, aMode);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get pin irq mode value
@@ -113,7 +168,15 @@ long AsGpio::setIrqMode(int aMode)
*/
long AsGpio::getIrqMode() const
{
- return as_gpio_get_irq_mode(mDev);
+ if (mDev != NULL)
+ {
+ return as_gpio_get_irq_mode(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get pin number value
@@ -122,7 +185,15 @@ long AsGpio::getIrqMode() const
*/
long AsGpio::getPinNum() const
{
- return as_gpio_get_pin_num(mDev);
+ if (mDev != NULL)
+ {
+ return as_gpio_get_pin_num(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get port letter
@@ -131,5 +202,13 @@ long AsGpio::getPinNum() const
*/
long AsGpio::getPortLetter() const
{
- return as_gpio_get_port_letter(mDev);
+ if (mDev != NULL)
+ {
+ return as_gpio_get_port_letter(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsGpio device structure not allocated"<<std::endl;
+ return -1;
+ }
}
diff --git a/target/packages/as_devices/cpp/as_i2c.cpp b/target/packages/as_devices/cpp/as_i2c.cpp
index af273c4..919fa8b 100644
--- a/target/packages/as_devices/cpp/as_i2c.cpp
+++ b/target/packages/as_devices/cpp/as_i2c.cpp
@@ -36,10 +36,17 @@ AsI2c::~AsI2c()
{
int ret;
- ret = as_i2c_close(mDev);
- if (ret < 0)
+ if (mDev != NULL)
{
- std::cout<<"AsI2c destruction error"<<std::endl;
+ ret = as_i2c_close(mDev);
+ if (ret < 0)
+ {
+ std::cout<<"AsI2c destruction error"<<std::endl;
+ }
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
}
}
@@ -51,7 +58,15 @@ AsI2c::~AsI2c()
*/
long AsI2c::setSlaveAddr(unsigned char aAddr)
{
- return as_i2c_set_slave_addr(mDev, aAddr);
+ if (mDev != NULL)
+ {
+ return as_i2c_set_slave_addr(mDev, aAddr);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Get chip's I2C slave address
@@ -60,7 +75,15 @@ long AsI2c::setSlaveAddr(unsigned char aAddr)
*/
long AsI2c::getSlaveAddr() const
{
- return as_i2c_get_slave_addr(mDev);
+ if (mDev != NULL)
+ {
+ return as_i2c_get_slave_addr(mDev);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Read several bytes (ioctl() method) from given chip.
@@ -72,7 +95,15 @@ long AsI2c::getSlaveAddr() const
*/
long AsI2c::read(unsigned char *aData, size_t aSize) const
{
- return as_i2c_read(mDev, aData, aSize);
+ if (mDev != NULL)
+ {
+ return as_i2c_read(mDev, aData, aSize);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Write several bytes (ioctl() method) to given chip.
@@ -84,7 +115,15 @@ long AsI2c::read(unsigned char *aData, size_t aSize) const
*/
long AsI2c::write(unsigned char *aData, size_t aSize)
{
- return as_i2c_write(mDev, aData, aSize);
+ if (mDev != NULL)
+ {
+ return as_i2c_write(mDev, aData, aSize);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Read from given chip at a given register address (ioctl() method).
@@ -97,7 +136,15 @@ long AsI2c::write(unsigned char *aData, size_t aSize)
*/
long AsI2c::readReg(unsigned char aReg, unsigned char *aData, size_t aSize) const
{
- return as_i2c_read_reg(mDev, aReg, aData, aSize);
+ if (mDev != NULL)
+ {
+ return as_i2c_read_reg(mDev, aReg, aData, aSize);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Write to given chip at a given register address (ioctl() method).
@@ -110,7 +157,15 @@ long AsI2c::readReg(unsigned char aReg, unsigned char *aData, size_t aSize) cons
*/
long AsI2c::writeReg(unsigned char aReg, unsigned char *aData, size_t aSize)
{
- return as_i2c_write_reg(mDev, aReg, aData, aSize);
+ if (mDev != NULL)
+ {
+ return as_i2c_write_reg(mDev, aReg, aData, aSize);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief forge a read message like this:
@@ -125,7 +180,15 @@ long AsI2c::writeReg(unsigned char aReg, unsigned char *aData, size_t aSize)
*/
long AsI2c::readMsg(unsigned char *aWData, unsigned char aWriteSize, unsigned char *aRData, size_t aReadSize)
{
- return as_i2c_read_msg(mDev, aWData, aWriteSize, aRData, aReadSize);
+ if (mDev != NULL)
+ {
+ return as_i2c_read_msg(mDev, aWData, aWriteSize, aRData, aReadSize);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Read a byte from the given register.
@@ -136,7 +199,15 @@ long AsI2c::readMsg(unsigned char *aWData, unsigned char aWriteSize, unsigned ch
*/
long AsI2c::readRegByte(unsigned char aReg) const
{
- return as_i2c_read_reg_byte(mDev, aReg);
+ if (mDev != NULL)
+ {
+ return as_i2c_read_reg_byte(mDev, aReg);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
/** @brief Write a byte to the given register.
@@ -148,5 +219,13 @@ long AsI2c::readRegByte(unsigned char aReg) const
*/
long AsI2c::writeRegByte(unsigned char aReg, unsigned char aVal)
{
- return as_i2c_write_reg_byte(mDev, aReg, aVal);
+ if (mDev != NULL)
+ {
+ return as_i2c_write_reg_byte(mDev, aReg, aVal);
+ }
+ else
+ {
+ std::cerr<<"AsI2c device structure not allocated"<<std::endl;
+ return -1;
+ }
}
diff --git a/target/packages/as_devices/cpp/as_spi.cpp b/target/packages/as_devices/cpp/as_spi.cpp
index 27428b3..538ca5e 100644
--- a/target/packages/as_devices/cpp/as_spi.cpp
+++ b/target/packages/as_devices/cpp/as_spi.cpp
@@ -21,6 +21,7 @@
*/
#include "as_spi.hpp"
+#include <iostream>
/** @brief Constructor: Open a SPI bus.
*
@@ -33,7 +34,14 @@ AsSpi::AsSpi(const unsigned char *aSpidev_name)
AsSpi::~AsSpi()
{
- as_spi_close(mFd);
+ if (mFd != 0)
+ {
+ as_spi_close(mFd);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ }
}
/** @brief Set bits order
@@ -44,7 +52,15 @@ AsSpi::~AsSpi()
*/
int AsSpi::setLsb(unsigned char aLsb)
{
- return as_spi_set_lsb(mFd, aLsb);
+ if (mFd != 0)
+ {
+ return as_spi_set_lsb(mFd, aLsb);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Get bits order
@@ -53,7 +69,15 @@ int AsSpi::setLsb(unsigned char aLsb)
*/
int AsSpi::getLsb() const
{
- return as_spi_get_lsb(mFd);
+ if (mFd != 0)
+ {
+ return as_spi_get_lsb(mFd);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Set spi bus mode
@@ -64,7 +88,15 @@ int AsSpi::getLsb() const
*/
int AsSpi::setMode(unsigned char aMode)
{
- return as_spi_set_mode(mFd, aMode);
+ if (mFd != 0)
+ {
+ return as_spi_set_mode(mFd, aMode);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Get spi bus mode
@@ -73,7 +105,15 @@ int AsSpi::setMode(unsigned char aMode)
*/
int AsSpi::getMode() const
{
- return as_spi_get_mode(mFd);
+ if (mFd != 0)
+ {
+ return as_spi_get_mode(mFd);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Set clock bus speed
@@ -84,7 +124,15 @@ int AsSpi::getMode() const
*/
int AsSpi::setSpeed(unsigned char aSpeed)
{
- return as_spi_set_speed(mFd, aSpeed);
+ if (mFd != 0)
+ {
+ return as_spi_set_speed(mFd, aSpeed);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Get clock bus speed
@@ -93,7 +141,15 @@ int AsSpi::setSpeed(unsigned char aSpeed)
*/
int AsSpi::getSpeed() const
{
- return as_spi_get_speed(mFd);
+ if (mFd != 0)
+ {
+ return as_spi_get_speed(mFd);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Get bits per word
@@ -102,7 +158,15 @@ int AsSpi::getSpeed() const
*/
int AsSpi::getBitsPerWord() const
{
- return as_spi_get_bits_per_word(mFd);
+ if (mFd != 0)
+ {
+ return as_spi_get_bits_per_word(mFd);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Set bits per word
@@ -113,7 +177,15 @@ int AsSpi::getBitsPerWord() const
*/
int AsSpi::setBitsPerWord(unsigned char aBits)
{
- return as_spi_set_bits_per_word(mFd, aBits);
+ if (mFd != 0)
+ {
+ return as_spi_set_bits_per_word(mFd, aBits);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
/** @brief Forge arbitrary length message (31bits max) and send it
@@ -126,5 +198,13 @@ int AsSpi::setBitsPerWord(unsigned char aBits)
*/
unsigned long long AsSpi::msg(unsigned long long aMsg, size_t aLen, unsigned long aSpeed)
{
- return as_spi_msg(mFd, aMsg, aLen, aSpeed);
+ if (mFd != 0)
+ {
+ return as_spi_msg(mFd, aMsg, aLen, aSpeed);
+ }
+ else
+ {
+ std::cerr<<"AsSpi file descriptor not initialized"<<std::endl;
+ return -1;
+ }
}
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-05-03 09:35:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via f73f2ee93f8ea1ca82586dfc0da4f8ec152221a4 (commit)
via df5a4542446b3fcd86103e529739a187b5d23cce (commit)
via 2bbfe7bd56166abd49217b144cba6597c7d83f0c (commit)
via f5bc389c8dae72e3b22dcec4db5b2b6048c9fb02 (commit)
from 77a4e144227f0741950365e739d56751ca957fd1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f73f2ee93f8ea1ca82586dfc0da4f8ec152221a4
Merge: df5a4542446b3fcd86103e529739a187b5d23cce 77a4e144227f0741950365e739d56751ca957fd1
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 3 11:34:47 2011 +0200
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit df5a4542446b3fcd86103e529739a187b5d23cce
Author: Julien Boibessot <jul...@ar...>
Date: Tue May 3 11:32:57 2011 +0200
[LINUX] 2.6.38: Add fpgaloader to APF51 default config
commit 2bbfe7bd56166abd49217b144cba6597c7d83f0c
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 2 15:46:52 2011 +0200
[DEMOS] Updates demos Makefiles to let them compile on new BR
commit f5bc389c8dae72e3b22dcec4db5b2b6048c9fb02
Author: Julien Boibessot <jul...@ar...>
Date: Mon May 2 14:54:23 2011 +0200
[BUILDROOT] Updates menuconfig help of following packages: ad9889ctrl, ch7024ctrl, max5821ctrl, tfp410ctrl
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/ad9889ctrl/Config.in | 8 +--
buildroot/package/armadeus/ch7024ctrl/Config.in | 8 +--
buildroot/package/armadeus/demos/demos.mk | 2 +-
buildroot/package/armadeus/max5821ctrl/Config.in | 7 +--
buildroot/package/armadeus/tfp410ctrl/Config.in | 5 +-
.../armadeus/apf51/apf51-linux-2.6.38.config | 45 ++++++++++++++++++-
target/demos/armanoid/Makefile | 6 +-
target/demos/backlight_control/Makefile | 6 +-
target/demos/input_test/Makefile | 6 +-
target/demos/test_lcd/Makefile | 6 +-
10 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/buildroot/package/armadeus/ad9889ctrl/Config.in b/buildroot/package/armadeus/ad9889ctrl/Config.in
index f36a8dc..e00cef6 100644
--- a/buildroot/package/armadeus/ad9889ctrl/Config.in
+++ b/buildroot/package/armadeus/ad9889ctrl/Config.in
@@ -1,8 +1,6 @@
config BR2_PACKAGE_AD9889CTRL
- bool "ad9889ctrl"
+ bool "ad9889 control"
depends on BR2_TARGET_ARMADEUS
- default n
help
- Build AD9889 control tool. It allows you to configure the HDMI/DVI
- output of the DevFull directly from Linux userspace (command ad9889).
-
+ Build "ad9889" control tool. It allows you to configure the HDMI/DVI
+ output of the APF27DevFull directly from Linux userspace.
diff --git a/buildroot/package/armadeus/ch7024ctrl/Config.in b/buildroot/package/armadeus/ch7024ctrl/Config.in
index 6d5794b..c1a9c6d 100644
--- a/buildroot/package/armadeus/ch7024ctrl/Config.in
+++ b/buildroot/package/armadeus/ch7024ctrl/Config.in
@@ -1,8 +1,6 @@
config BR2_PACKAGE_CH7024CTRL
- bool "ch7024ctrl"
+ bool "ch7024 control"
depends on BR2_TARGET_ARMADEUS
- default n
help
- Build CH7024 control tool. It allows you to configure the Svideo
- output of the DevFull directly from Linux userspace (command ch7024).
-
+ Build "ch7024" control tool. It allows you to configure the S-Video
+ output of the APF9328DevFull directly from Linux userspace.
diff --git a/buildroot/package/armadeus/demos/demos.mk b/buildroot/package/armadeus/demos/demos.mk
index db6f92a..eda3163 100644
--- a/buildroot/package/armadeus/demos/demos.mk
+++ b/buildroot/package/armadeus/demos/demos.mk
@@ -79,7 +79,7 @@ $(ARMADEUS-DEMOS_DIR)/.compiled: $(ARMADEUS-DEMOS_DIR)/.unpacked
echo -e "\n >>> Compiling $$dir demo <<<" ; \
dir=$(ARMADEUS-DEMOS_DIR)/$$dir ; \
if [ -d "$$dir" ]; then \
- (cd $$dir && $(MAKE) CC="$(TARGET_CC)" SDL_DIR=$(SDL_DIR) STAGING_DIR=$(STAGING_DIR) ARMADEUS_BOARD_NAME=$(BR2_BOARD_NAME)) || exit 1 ; \
+ (cd $$dir && $(MAKE) CC="$(TARGET_CC)" STAGING_DIR=$(STAGING_DIR) ARMADEUS_BOARD_NAME=$(BR2_BOARD_NAME)) || exit 1 ; \
fi \
done
touch $@
diff --git a/buildroot/package/armadeus/max5821ctrl/Config.in b/buildroot/package/armadeus/max5821ctrl/Config.in
index a1dfacc..370db92 100644
--- a/buildroot/package/armadeus/max5821ctrl/Config.in
+++ b/buildroot/package/armadeus/max5821ctrl/Config.in
@@ -1,7 +1,6 @@
config BR2_PACKAGE_MAX5821CTRL
- bool "max5821ctrl"
- default y
+ bool "max5821 control (setDAC)"
help
This tool allows you to configure the MAX5821 I2C DAC directly
- from Linux userspace (setDAC command).
-
+ from Linux userspace ("setDAC" command) on your APF9328DevFull or
+ on your APF27DevFull.
diff --git a/buildroot/package/armadeus/tfp410ctrl/Config.in b/buildroot/package/armadeus/tfp410ctrl/Config.in
index 74232e9..c6ecd0f 100644
--- a/buildroot/package/armadeus/tfp410ctrl/Config.in
+++ b/buildroot/package/armadeus/tfp410ctrl/Config.in
@@ -2,6 +2,5 @@ config BR2_PACKAGE_TFP410CTRL
bool "tfp410ctrl"
depends on BR2_TARGET_ARMADEUS
help
- Build TFP410 control tool. It allows you to configure the HDMI/DVI
- output of the APF51Dev directly from Linux userspace (tfp410ctrl
- command).
+ Build "tfp410ctrl" tool. It allows you to configure the HDMI/DVI
+ output of the APF51Dev directly from Linux userspace.
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index b14dd1d..7585d77 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Fri Apr 29 14:08:07 2011
+# Tue May 3 11:14:27 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1689,12 +1689,51 @@ CONFIG_USB_ULPI=y
#
# Armadeus specific drivers
#
-# CONFIG_ARMADEUS_DRIVERS is not set
+CONFIG_ARMADEUS_DRIVERS=y
+
+#
+# Misc.
+#
+# CONFIG_ARMADEUS_GENERIC_DRIVER is not set
+# CONFIG_ARMADEUS_AS1531_PLAT is not set
+# CONFIG_ARMADEUS_GPIO_DRIVER is not set
+# CONFIG_ARMADEUS_KEYPAD_DRIVER is not set
+# CONFIG_ARMADEUS_MAX1027 is not set
+# CONFIG_ARMADEUS_MAX9768 is not set
+
+#
+# FPGA related
+#
#
# FPGA Drivers
#
-# CONFIG_ARMADEUS_FPGA_DRIVERS is not set
+CONFIG_ARMADEUS_FPGA_DRIVERS=y
+
+#
+# Drivers for configuring and testing the FPGA
+#
+CONFIG_ARMADEUS_FPGA_LOADER_DRIVER=m
+
+#
+# Others drivers for the FPGA
+#
+# CONFIG_ARMADEUS_I2C_OCORE_IRQMNG is not set
+# CONFIG_ARMADEUS_PS2KBD_DRIVER is not set
+# CONFIG_ARMADEUS_WISHBONE_EXAMPLE_DRIVERS is not set
+# CONFIG_POD_DRIVERS is not set
+
+#
+# Handheld related
+#
+# CONFIG_ARMADEUS_PWM_DRIVER is not set
+# CONFIG_IMX_BACKLIGHT is not set
+# CONFIG_HX5116_DISPLAY is not set
+
+#
+# Communication bus related
+#
+# CONFIG_ARMADEUS_ISP1761 is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
diff --git a/target/demos/armanoid/Makefile b/target/demos/armanoid/Makefile
index c459442..34b18ed 100644
--- a/target/demos/armanoid/Makefile
+++ b/target/demos/armanoid/Makefile
@@ -2,16 +2,16 @@
ARMADEUS_BASE_DIR=../../..
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-SDL_DIR:=$(ARMADEUS_BUILD_DIR)/SDL-$(ARMADEUS_SDL_VERSION)
STAGING_DIR:=$(ARMADEUS_BUILD_DIR)/staging_dir/
+SDL_CONFIG:=$(STAGING_DIR)/usr/bin/sdl-config
INSTALL_DIR:=$(ARMADEUS_ROOTFS_DIR)/usr/local/bin
INSTALL_DATA_DIR:=$(ARMADEUS_ROOTFS_DIR)/usr/share
CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
DEFINES=TARGET
-CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --cflags) -g
-LIBS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --libs)
+CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --cflags) -g
+LIBS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --libs)
ifeq ($(TARGET),x86)
INSTALL_DIR="/usr/games/"
diff --git a/target/demos/backlight_control/Makefile b/target/demos/backlight_control/Makefile
index 506f817..5977fba 100644
--- a/target/demos/backlight_control/Makefile
+++ b/target/demos/backlight_control/Makefile
@@ -8,9 +8,9 @@ CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-sstrip
DEFINES=-DTARGET
STAGING_DIR:=$(ARMADEUS_STAGING_DIR)
-SDL_DIR:=$(ARMADEUS_SDL_DIR)
-CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --cflags) -g
-LDFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --libs) -lSDL_image
+SDL_CONFIG:=$(STAGING_DIR)/usr/bin/sdl-config
+CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --cflags) -g
+LDFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --libs) -lSDL_image
ifeq ($(TARGET),x86)
INSTALL_DIR:=/usr/local/bin
diff --git a/target/demos/input_test/Makefile b/target/demos/input_test/Makefile
index 0513ecb..4ba86e7 100644
--- a/target/demos/input_test/Makefile
+++ b/target/demos/input_test/Makefile
@@ -7,9 +7,9 @@ INSTALL_DIR:=$(ARMADEUS_ROOTFS_DIR)/usr/local/bin/
INSTALL_DATA_DIR:=$(ARMADEUS_ROOTFS_DIR)/usr/share
CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-sstrip
-SDL_DIR:=$(ARMADEUS_SDL_DIR)
-CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --cflags) -g
-LIBS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --libs)
+SDL_CONFIG:=$(STAGING_DIR)/usr/bin/sdl-config
+CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --cflags) -g
+LIBS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --libs)
DEFINES=-DAPF
ifeq ($(TARGET),x86)
diff --git a/target/demos/test_lcd/Makefile b/target/demos/test_lcd/Makefile
index fed69b9..24cdb37 100644
--- a/target/demos/test_lcd/Makefile
+++ b/target/demos/test_lcd/Makefile
@@ -7,9 +7,9 @@ INSTALL_DATA_DIR:=$(ARMADEUS_ROOTFS_DIR)/usr/share
CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-sstrip
STAGING_DIR:=$(ARMADEUS_STAGING_DIR)
-SDL_DIR:=$(ARMADEUS_SDL_DIR)
-CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --cflags) -g
-LDFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --libs)
+SDL_CONFIG:=$(STAGING_DIR)/usr/bin/sdl-config
+CFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --cflags) -g
+LDFLAGS=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_CONFIG) --libs)
ifeq ($(TARGET),x86)
INSTALL_DIR:=/usr/local/bin
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2011-05-02 22:07:03
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 77a4e144227f0741950365e739d56751ca957fd1 (commit)
via 626b32de86f494d13c5cbe3c4c0ec15ef85914f1 (commit)
via 07a29b67d077ddffbd480fca6ab4684f214c2270 (commit)
from fd138818bafd8a0f5d19c994a509d72f382e9b7d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 77a4e144227f0741950365e739d56751ca957fd1
Merge: 626b32de86f494d13c5cbe3c4c0ec15ef85914f1 fd138818bafd8a0f5d19c994a509d72f382e9b7d
Author: jorasse <jo...@ar...>
Date: Tue May 3 00:08:52 2011 +0200
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 626b32de86f494d13c5cbe3c4c0ec15ef85914f1
Author: jorasse <jo...@ar...>
Date: Tue May 3 00:08:26 2011 +0200
[LINUX][2.6.38][APF51] Fix mx51 NAND OOB definition to be compliant with mx51 chipset specification
commit 07a29b67d077ddffbd480fca6ab4684f214c2270
Author: jorasse <jo...@ar...>
Date: Tue May 3 00:04:30 2011 +0200
[UBOOT][APF51] Change NAND OOB definition to be compliant with mx51 linux kernel NAND driver
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf51/apf51-u-boot-2010.03.h | 8 +++++---
.../2.6.38/404-armadeus-fix_nand_ecc_oob.patch | 2 +-
.../u-boot/u-boot-2010.03-407-imx51-nand.patch | 14 ++++++++++----
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
index bc72ae1..3a4694c 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
+++ b/buildroot/target/device/armadeus/apf51/apf51-u-boot-2010.03.h
@@ -2,7 +2,7 @@
*
* Configuration settings for the Armadeus Project apf51 board.
*
- * (C) Copyright 2010 Eric Jarrige, Armadeus Project
+ * (C) Copyright 2010,2011 Eric Jarrige, Armadeus Project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -20,14 +20,16 @@
* MA 02111-1307 USA
*
* 2010/03/31 Initial version based on apf27 configuration file
+ * 2011/05/02 patch V0.5 updates NAND OOB to be mx51 linux kernel compliant
+ * (at least for the first 11 spare bytes..)
*/
#ifndef __CONFIG_H
#define __CONFIG_H
#define CONFIG_VERSION_VARIABLE
-#define CONFIG_ENV_VERSION "0.4"
-#define CONFIG_IDENT_STRING " apf51 patch 0.4"
+#define CONFIG_ENV_VERSION "0.5"
+#define CONFIG_IDENT_STRING " apf51 patch 0.5"
//#define APF51_PROTO
//#define APF51_RECOVER
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/404-armadeus-fix_nand_ecc_oob.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/404-armadeus-fix_nand_ecc_oob.patch
index 0338f4d..422e8f1 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/404-armadeus-fix_nand_ecc_oob.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/404-armadeus-fix_nand_ecc_oob.patch
@@ -19,7 +19,7 @@ Index: linux-2.6.38-alpha/drivers/mtd/nand/mxc_nand.c
+ 136, 137, 138, 139, 140, 141, 142, 143,
+ 200, 201, 202, 203, 204, 205, 206, 207
+ },
-+ .oobfree = { {16, 56}, {80, 56}, {144, 56}, {208, 48} },
++ .oobfree = { {2, 4}, {16, 56}, {80, 56}, {144, 56}, {208, 48} },
+};
+
#ifdef CONFIG_MTD_PARTITIONS
diff --git a/buildroot/target/u-boot/u-boot-2010.03-407-imx51-nand.patch b/buildroot/target/u-boot/u-boot-2010.03-407-imx51-nand.patch
index f0fc854..b7a7c8b 100644
--- a/buildroot/target/u-boot/u-boot-2010.03-407-imx51-nand.patch
+++ b/buildroot/target/u-boot/u-boot-2010.03-407-imx51-nand.patch
@@ -14,7 +14,7 @@ Index: u-boot-2010.03/drivers/mtd/nand/mx51_nand.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-2010.03/drivers/mtd/nand/mx51_nand.c 2011-01-05 18:11:47.000000000 +0100
-@@ -0,0 +1,979 @@
+@@ -0,0 +1,985 @@
+/*
+ * Copyright (C) 2010 Eric Jarrige <jo...@ar...>
+ * Copyright 2004-2007 Freescale Semiconductor, Inc.
@@ -175,13 +175,19 @@ Index: u-boot-2010.03/drivers/mtd/nand/mx51_nand.c
+
+
+static struct nand_ecclayout nand_hw_eccoob2k = {
-+ .eccbytes = 8,
++ .eccbytes = 4 * 8,
+ .eccpos = {
+ 8, 9, 10, 11, 12, 13, 14, 15,
++ 72, 73, 74, 75, 76, 77, 78, 79,
++ 136, 137, 138, 139, 140, 141, 142, 143,
++ 200, 201, 202, 203, 204, 205, 206, 207
+ },
+ .oobfree = {
-+ {.offset = 2, .length = 5},
-+ {.offset = 16, .length = 48}
++ {.offset = 2, .length = 4},
++ {.offset = 16, .length = 56},
++ {.offset = 80, .length = 56},
++ {.offset = 144, .length = 56},
++ {.offset = 208, .length = 48}
+ },
+};
+
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-05-02 13:01:00
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via fd138818bafd8a0f5d19c994a509d72f382e9b7d (commit)
from 52dceeef8c0448fd76393ef989171770a3082d13 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fd138818bafd8a0f5d19c994a509d72f382e9b7d
Author: Nicolas Colombain <nic...@ar...>
Date: Mon May 2 15:00:33 2011 +0200
[TOOLS] change fpga loader version and avoid test of init after download (copy of uboot procedure)
-----------------------------------------------------------------------
Summary of changes:
.../modules/fpga/dev_tools/loader/fpga-loader.c | 2 +-
.../fpga/dev_tools/loader/xilinx-fpga-loader.c | 6 ------
2 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/target/linux/modules/fpga/dev_tools/loader/fpga-loader.c b/target/linux/modules/fpga/dev_tools/loader/fpga-loader.c
index f950207..b49b01f 100644
--- a/target/linux/modules/fpga/dev_tools/loader/fpga-loader.c
+++ b/target/linux/modules/fpga/dev_tools/loader/fpga-loader.c
@@ -33,7 +33,7 @@
#include "xilinx-fpga-loader.h"
-#define DRIVER_VERSION "0.91"
+#define DRIVER_VERSION "0.92"
#define DRIVER_NAME "fpgaloader"
#define FPGA_PROC_DIRNAME "driver/fpga"
#define FPGA_PROC_FILENAME FPGA_PROC_DIRNAME "/loader"
diff --git a/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c b/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c
index 4897f88..84c2afd 100644
--- a/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c
+++ b/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c
@@ -290,12 +290,6 @@ static int spartan_parallel_finish(struct fpga_desc *desc)
return -ETIMEDOUT;
}
}
- /* Spartan signals an error if INIT goes low (active) */
- if (!(*fn->init)()) {
- printk("** CRC error during FPGA load.\n");
- (*fn->abort) (); /* abort the burn */
- return -ETIMEDOUT;
- }
(*fn->cs) (0); /* Deassert the chip select */
(*fn->wr) (0); /* Deassert the write pin */
(*fn->post) (); /* release resources */
hooks/post-receive
--
armadeus
|