armadeus-commitlog Mailing List for armadeus (Page 111)
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...> - 2010-03-22 22:29:39
|
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 cbd92a077dde9804513a86424c249c941d7c9e1e (commit)
from aeabb3b33a5e7c67cf604c6fbcd689ab89da3d54 (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 cbd92a077dde9804513a86424c249c941d7c9e1e
Author: jorasse <jo...@ar...>
Date: Mon Mar 22 23:29:02 2010 +0100
[U-Boot] update rules to generate U-Boot binary files
-----------------------------------------------------------------------
Summary of changes:
.../target/device/armadeus/apf9328/Makefile.in | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf9328/Makefile.in b/buildroot/target/device/armadeus/apf9328/Makefile.in
index a6e01f7..505d2b3 100644
--- a/buildroot/target/device/armadeus/apf9328/Makefile.in
+++ b/buildroot/target/device/armadeus/apf9328/Makefile.in
@@ -1,4 +1,7 @@
TARGETS+=u-boot-brec
-ifneq ($(BR2_VERSION),"0.10.0-svn")
+ifeq ($(BR2_VERSION),"0.10.0-svn")
+U_BOOT_BINLOC=u-boot.bin
+else
+U_BOOT_BIN=u-boot.bin
U_BOOT_TARGET_BIN:=$(BOARD_NAME)-u-boot.bin
endif
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2010-03-21 23:56: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 aeabb3b33a5e7c67cf604c6fbcd689ab89da3d54 (commit)
via 81acb700fd42a51008df6ae2d1b09068ab8be9f5 (commit)
from c35ca8ec87a1b91a4e642b252de5c0bef056868c (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 aeabb3b33a5e7c67cf604c6fbcd689ab89da3d54
Author: jorasse <jo...@ar...>
Date: Mon Mar 22 00:55:18 2010 +0100
[U-Boot] fixed apf9328 GCC4.4.x EABI compilation issues
commit 81acb700fd42a51008df6ae2d1b09068ab8be9f5
Author: jorasse <jo...@ar...>
Date: Sun Mar 21 23:20:42 2010 +0100
[Buildroot] Fixed apf27 UBoot boardname
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf27_defconfig | 2 +-
.../target/device/armadeus/apf27/apf27_defconfig | 2 +-
...pf9328-fixes_gcc_4_4_EABI_linking_issues.patch} | 34 ++++++-------------
3 files changed, 13 insertions(+), 25 deletions(-)
copy buildroot/target/u-boot/{u-boot-1.3.4-401-fixes_EABI_linking_problems_with_gcc_4_3_and_gcc_4_4.patch => u-boot-1.3.4-402-apf9328-fixes_gcc_4_4_EABI_linking_issues.patch} (67%)
diff --git a/buildroot/configs/apf27_defconfig b/buildroot/configs/apf27_defconfig
index 43ce110..41f2c42 100644
--- a/buildroot/configs/apf27_defconfig
+++ b/buildroot/configs/apf27_defconfig
@@ -789,7 +789,7 @@ BR2_TARGET_ROOTFS_TAR_COPYTO=""
# bootloader for target device
#
BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="$(BOARD_NAME)"
+BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME).h"
BR2_TARGET_UBOOT_1_3_4=y
# BR2_TARGET_UBOOT_2009_11 is not set
diff --git a/buildroot/target/device/armadeus/apf27/apf27_defconfig b/buildroot/target/device/armadeus/apf27/apf27_defconfig
index a7a1ece..02805ee 100644
--- a/buildroot/target/device/armadeus/apf27/apf27_defconfig
+++ b/buildroot/target/device/armadeus/apf27/apf27_defconfig
@@ -771,7 +771,7 @@ BR2_TARGET_ROOTFS_TAR_COPYTO=""
# bootloader for target device
#
BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="$(BOARD_NAME)"
+BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME).h"
BR2_TARGET_UBOOT_CUSTOM_PATCH=""
BR2_TARGET_UBOOT_SERVERIP=""
diff --git a/buildroot/target/u-boot/u-boot-1.3.4-401-fixes_EABI_linking_problems_with_gcc_4_3_and_gcc_4_4.patch b/buildroot/target/u-boot/u-boot-1.3.4-402-apf9328-fixes_gcc_4_4_EABI_linking_issues.patch
similarity index 67%
copy from buildroot/target/u-boot/u-boot-1.3.4-401-fixes_EABI_linking_problems_with_gcc_4_3_and_gcc_4_4.patch
copy to buildroot/target/u-boot/u-boot-1.3.4-402-apf9328-fixes_gcc_4_4_EABI_linking_issues.patch
index a95e65c..7191662 100644
--- a/buildroot/target/u-boot/u-boot-1.3.4-401-fixes_EABI_linking_problems_with_gcc_4_3_and_gcc_4_4.patch
+++ b/buildroot/target/u-boot/u-boot-1.3.4-402-apf9328-fixes_gcc_4_4_EABI_linking_issues.patch
@@ -14,19 +14,18 @@ xxx/buildroot/output/build/staging_dir/usr/bin-ccache/../lib/gcc/arm-linux-uclib
Signed-off-by: Julien Boibessot <jul...@ar...>
---- u-boot-1.3.4.org/board/armadeus/apf27/apf27.c 2010-02-08 11:48:29.000000000 +0100
-+++ u-boot-1.3.4/board/armadeus/apf27/apf27.c 2010-02-05 23:01:33.000000000 +0100
-@@ -179,3 +179,7 @@
- printf("Armadeus APF2\n");
- return 0;
+--- u-boot-1.3.4/board/armadeus/apf9328/apf9328.c 2010-03-22 00:41:51.000000000 +0100
++++ u-boot-1.3.4.new/board/armadeus/apf9328/apf9328.c 2010-03-22 00:31:05.000000000 +0100
+@@ -99,3 +99,6 @@ show_boot_progress (int status)
+ {
+ return;
}
+
+void raise() {}
+void abort() {}
-+
---- u-boot-1.3.4.org/board/armadeus/apf27/u-boot-nand.lds 2010-02-08 11:48:29.000000000 +0100
-+++ u-boot-1.3.4/board/armadeus/apf27/u-boot-nand.lds 2010-02-05 22:55:57.000000000 +0100
-@@ -37,6 +37,10 @@
+--- u-boot-1.3.4/board/armadeus/apf9328/u-boot.lds 2010-03-22 00:41:51.000000000 +0100
++++ u-boot-1.3.4.new/board/armadeus/apf9328/u-boot.lds 2010-03-22 00:34:06.000000000 +0100
+@@ -38,6 +38,10 @@ SECTIONS
. = ALIGN(4);
.rodata : { *(.rodata) }
@@ -37,23 +36,12 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
. = ALIGN(4);
.data : { *(.data) }
---- u-boot-1.3.4.org/cpu/arm926ejs/config.mk 2010-02-08 11:48:29.000000000 +0100
-+++ u-boot-1.3.4/cpu/arm926ejs/config.mk 2010-02-05 23:03:48.000000000 +0100
-@@ -30,5 +30,5 @@
+--- u-boot-1.3.4/cpu/arm920t/config.mk 2008-08-12 16:08:38.000000000 +0200
++++ u-boot-1.3.4.new/cpu/arm920t/config.mk 2010-03-22 00:26:23.000000000 +0100
+@@ -30,5 +30,5 @@ PLATFORM_CPPFLAGS += -march=armv4
# Supply options according to compiler version
#
# =========================================================================
-PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_CPPFLAGS +=$(call cc-option)
PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
---- u-boot-1.3.4.org/Makefile 2010-02-08 11:48:29.000000000 +0100
-+++ u-boot-1.3.4/Makefile 2010-02-05 22:58:40.000000000 +0100
-@@ -253,7 +253,7 @@
- LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
-
- # Add GCC lib
--PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
-+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc -lgcc_eh
-
- # The "tools" are needed early, so put this first
- # Don't include stuff already done in $(LIBS)
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2010-03-21 21:15:10
|
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 c35ca8ec87a1b91a4e642b252de5c0bef056868c (commit)
via 20de60cbe214e5c09c156ad9814f2b2666bc4b80 (commit)
via 4cf6958f87a52eb94ee8ff845432e24b87bdd20f (commit)
from 54cf84bf2865ae823413b9c0082d321b6c684567 (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 c35ca8ec87a1b91a4e642b252de5c0bef056868c
Author: jorasse <jo...@ar...>
Date: Sun Mar 21 21:53:55 2010 +0100
improved apf9328 default configuration to be used with new buildroot
commit 20de60cbe214e5c09c156ad9814f2b2666bc4b80
Author: jorasse <jo...@ar...>
Date: Sun Mar 21 13:42:45 2010 +0100
added default uclibc config for new buildroot
commit 4cf6958f87a52eb94ee8ff845432e24b87bdd20f
Author: jorasse <jo...@ar...>
Date: Sun Mar 21 13:20:09 2010 +0100
added default apf9328 to be used with new buildroot
-----------------------------------------------------------------------
Summary of changes:
.../configs/{apf27_defconfig => apf9328_defconfig} | 54 +++++++++-----------
.../{apf27 => apf9328}/uClibc-0.9.30.config.arm | 10 ++--
2 files changed, 30 insertions(+), 34 deletions(-)
copy buildroot/configs/{apf27_defconfig => apf9328_defconfig} (95%)
copy buildroot/target/device/armadeus/{apf27 => apf9328}/uClibc-0.9.30.config.arm (94%)
diff --git a/buildroot/configs/apf27_defconfig b/buildroot/configs/apf9328_defconfig
similarity index 95%
copy from buildroot/configs/apf27_defconfig
copy to buildroot/configs/apf9328_defconfig
index 43ce110..fca7fb3 100644
--- a/buildroot/configs/apf27_defconfig
+++ b/buildroot/configs/apf9328_defconfig
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Tue Feb 23 09:17:23 2010
+# Sun Mar 21 13:16:38 2010
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="2010.02-rc1"
@@ -27,9 +27,9 @@ BR2_arm=y
# BR2_arm610 is not set
# BR2_arm710 is not set
# BR2_arm720t is not set
-# BR2_arm920t is not set
+BR2_arm920t=y
# BR2_arm922t is not set
-BR2_arm926t=y
+# BR2_arm926t is not set
# BR2_arm10t is not set
# BR2_arm1136jf_s is not set
# BR2_arm1176jz_s is not set
@@ -43,13 +43,13 @@ BR2_arm926t=y
# BR2_sa1100 is not set
# BR2_xscale is not set
# BR2_iwmmxt is not set
-BR2_ARM_TYPE="ARM926T"
+BR2_ARM_TYPE="ARM920T"
BR2_ARM_EABI=y
# BR2_ARM_OABI is not set
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
-BR2_GCC_TARGET_TUNE="arm9tdmi"
-BR2_GCC_TARGET_ARCH="armv5te"
+BR2_GCC_TARGET_TUNE="arm920t"
+BR2_GCC_TARGET_ARCH="armv4t"
BR2_GCC_TARGET_ABI="aapcs-linux"
#
@@ -60,19 +60,15 @@ BR2_GCC_TARGET_ABI="aapcs-linux"
# Preset Devices
#
BR2_TARGET_ARMADEUS=y
-# BR2_TARGET_ARMADEUS_APF9328 is not set
-BR2_TARGET_ARMADEUS_APF27=y
-BR2_BOARD_NAME="apf27"
+BR2_TARGET_ARMADEUS_APF9328=y
+# BR2_TARGET_ARMADEUS_APF27 is not set
+BR2_BOARD_NAME="apf9328"
BR2_BOARD_PATH="target/device/armadeus/$(BR2_BOARD_NAME)"
-# BR2_TARGET_ARMADEUS_APF27_SDRAM_16 is not set
-# BR2_TARGET_ARMADEUS_APF27_SDRAM_32 is not set
-BR2_TARGET_ARMADEUS_APF27_SDRAM_64=y
-# BR2_TARGET_ARMADEUS_APF27_SDRAM_128 is not set
-# BR2_TARGET_ARMADEUS_APF27_SDRAM_256 is not set
-BR2_TARGET_ARMADEUS_NR_SDRAM_1=y
-# BR2_TARGET_ARMADEUS_NR_SDRAM_2 is not set
-BR2_TARGET_ARMADEUS_NR_SDRAM="1"
-BR2_TARGET_ARMADEUS_SDRAM_SIZE="64"
+# BR2_TARGET_ARMADEUS_SDRAM_8 is not set
+BR2_TARGET_ARMADEUS_SDRAM_16=y
+# BR2_TARGET_ARMADEUS_SDRAM_32 is not set
+# BR2_TARGET_ARMADEUS_SDRAM_64 is not set
+BR2_TARGET_ARMADEUS_SDRAM_SIZE="16"
# BR2_TARGET_ARMLTD is not set
# BR2_TARGET_ATMEL is not set
# BR2_TARGET_KWIKBYTE is not set
@@ -313,9 +309,9 @@ BR2_HOST_FAKEROOT=y
#
# Armadeus specific tools/utilities
#
-BR2_PACKAGE_AD9889CTRL=y
+# BR2_PACKAGE_AD9889CTRL is not set
# BR2_PACKAGE_AS_DEVICES is not set
-# BR2_PACKAGE_CH7024CTRL is not set
+BR2_PACKAGE_CH7024CTRL=y
# BR2_PACKAGE_ARMADEUS_DEMOS is not set
BR2_PACKAGE_FPGAREGS=y
BR2_PACKAGE_IMXREGS=y
@@ -362,7 +358,7 @@ BR2_PACKAGE_MAX5821CTRL=y
# BR2_PACKAGE_SCREEN is not set
# BR2_PACKAGE_SHARED_MIME_INFO is not set
# BR2_PACKAGE_STARTUP_NOTIFICATION is not set
-BR2_PACKAGE_STRACE=y
+# BR2_PACKAGE_STRACE is not set
# BR2_PACKAGE_SUDO is not set
# BR2_PACKAGE_XENOMAI is not set
@@ -461,7 +457,7 @@ BR2_PACKAGE_PORTMAP=y
# BR2_PACKAGE_VSFTPD is not set
# BR2_PACKAGE_VTUN is not set
# BR2_PACKAGE_WEBIF is not set
-BR2_PACKAGE_WIRELESS_TOOLS=y
+# BR2_PACKAGE_WIRELESS_TOOLS is not set
# BR2_PACKAGE_WPA_SUPPLICANT is not set
#
@@ -483,7 +479,7 @@ BR2_PACKAGE_WIRELESS_TOOLS=y
# BR2_PACKAGE_GVFS is not set
# BR2_PACKAGE_HAL is not set
# BR2_PACKAGE_HWDATA is not set
-BR2_PACKAGE_I2C_TOOLS=y
+# BR2_PACKAGE_I2C_TOOLS is not set
# BR2_PACKAGE_INPUT_TOOLS is not set
# BR2_PACKAGE_IOSTAT is not set
# BR2_PACKAGE_LCD4LINUX is not set
@@ -578,7 +574,7 @@ BR2_PACKAGE_ALSA_UTILS_ALSAMIXER=y
# BR2_PACKAGE_ALSA_UTILS_AMIDI is not set
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
BR2_PACKAGE_ALSA_UTILS_APLAY=y
-BR2_PACKAGE_ALSA_UTILS_ARECORD=y
+# BR2_PACKAGE_ALSA_UTILS_ARECORD is not set
# BR2_PACKAGE_ALSA_UTILS_IECSET is not set
# BR2_PACKAGE_ALSA_UTILS_ACONNECT is not set
# BR2_PACKAGE_ALSA_UTILS_APLAYMIDI is not set
@@ -758,13 +754,13 @@ BR2_TARGET_ROOTFS_JFFS2=y
# BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set
# BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528 is not set
# BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_512_16K is not set
-BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K=y
-# BR2_TARGET_ROOTFS_JFFS2_FLASH_128 is not set
+# BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K is not set
+BR2_TARGET_ROOTFS_JFFS2_FLASH_128=y
# BR2_TARGET_ROOTFS_JFFS2_FLASH_64 is not set
# BR2_TARGET_ROOTFS_JFFS2_CUSTOM is not set
-BR2_TARGET_ROOTFS_JFFS2_PAGESIZE=0x800
+BR2_TARGET_ROOTFS_JFFS2_PAGESIZE=0x1000
BR2_TARGET_ROOTFS_JFFS2_EBSIZE=0x20000
-BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER=y
+# BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER is not set
# BR2_JFFS2_TARGET_SREC is not set
BR2_TARGET_ROOTFS_JFFS2_PAD=y
BR2_TARGET_ROOTFS_JFFS2_PADSIZE=0x0
@@ -789,7 +785,7 @@ BR2_TARGET_ROOTFS_TAR_COPYTO=""
# bootloader for target device
#
BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="$(BOARD_NAME)"
+BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME).h"
BR2_TARGET_UBOOT_1_3_4=y
# BR2_TARGET_UBOOT_2009_11 is not set
diff --git a/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm b/buildroot/target/device/armadeus/apf9328/uClibc-0.9.30.config.arm
similarity index 94%
copy from buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm
copy to buildroot/target/device/armadeus/apf9328/uClibc-0.9.30.config.arm
index 0ef197a..1ec58f3 100644
--- a/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm
+++ b/buildroot/target/device/armadeus/apf9328/uClibc-0.9.30.config.arm
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Version: 0.9.30.2
-# Mon Feb 1 14:24:52 2010
+# Sun Mar 21 13:27:47 2010
#
# TARGET_alpha is not set
TARGET_arm=y
@@ -42,9 +42,9 @@ CONFIG_ARM_EABI=y
# CONFIG_ARM710 is not set
# CONFIG_ARM7TDMI is not set
# CONFIG_ARM720T is not set
-# CONFIG_ARM920T is not set
+CONFIG_ARM920T=y
# CONFIG_ARM922T is not set
-CONFIG_ARM926T=y
+# CONFIG_ARM926T is not set
# CONFIG_ARM10T is not set
# CONFIG_ARM1136JF_S is not set
# CONFIG_ARM1176JZ_S is not set
@@ -71,7 +71,7 @@ UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_SOFT_FLOAT=y
DO_C99_MATH=y
# UCLIBC_HAS_FENV is not set
-KERNEL_HEADERS="/home/julien/workspace/Armadeus_SF/armadeus-git-new-buildroot/buildroot/output/toolchain/linux/include"
+KERNEL_HEADERS="/home/eric/arm/armahead/buildroot/output/toolchain/linux/include"
HAVE_DOT_CONFIG=y
#
@@ -227,7 +227,7 @@ UCLIBC_BUILD_NOW=y
#
# uClibc development/debugging options
#
-CROSS_COMPILER_PREFIX="/home/julien/workspace/Armadeus_SF/armadeus-git-new-buildroot/buildroot/output/build/staging_dir/usr/bin/arm-linux-uclibcgnueabi-"
+CROSS_COMPILER_PREFIX="/home/eric/arm/armahead/buildroot/output/build/staging_dir/usr/bin/arm-linux-uclibc-"
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DODEBUG_PT is not set
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-19 22:32:30
|
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 54cf84bf2865ae823413b9c0082d321b6c684567 (commit)
from 6c160db149b5b0781d1a76949378113ee1875b5e (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 54cf84bf2865ae823413b9c0082d321b6c684567
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 19 23:32:04 2010 +0100
[BUILDROOT] mkfs.ubifs depends on mtd-host
-----------------------------------------------------------------------
Summary of changes:
patches/buildroot/076-ubifs.patch | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/patches/buildroot/076-ubifs.patch b/patches/buildroot/076-ubifs.patch
index e5171ca..6b53383 100644
--- a/patches/buildroot/076-ubifs.patch
+++ b/patches/buildroot/076-ubifs.patch
@@ -44,7 +44,7 @@
+endif
+
+
-+$(UBIFS_BASE): host-fakeroot makedevs
++$(UBIFS_BASE): host-fakeroot makedevs mtd-host
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
ifneq ($(BR2_HAVE_MANPAGES),y)
@rm -rf $(TARGET_DIR)/usr/man
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-19 15:34:59
|
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 6c160db149b5b0781d1a76949378113ee1875b5e (commit)
from 533811eb2bc49f0015b7caa1e9d300d1f7cc836e (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 6c160db149b5b0781d1a76949378113ee1875b5e
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 19 16:18:31 2010 +0100
[LINUX] Indentation in 015-armadeus-logo-add_armadeus-project_tux.patch
-----------------------------------------------------------------------
Summary of changes:
...15-armadeus-logo-add_armadeus-project_tux.patch | 28 ++++++++++----------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/015-armadeus-logo-add_armadeus-project_tux.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/015-armadeus-logo-add_armadeus-project_tux.patch
index 79c4f76..ae35cf5 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/015-armadeus-logo-add_armadeus-project_tux.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/015-armadeus-logo-add_armadeus-project_tux.patch
@@ -1,7 +1,7 @@
-Index: linux-2.6.29.4/drivers/video/logo/Kconfig
+Index: linux-2.6.29.6/drivers/video/logo/Kconfig
===================================================================
---- linux-2.6.29.4.orig/drivers/video/logo/Kconfig 2009-03-24 00:12:14.000000000 +0100
-+++ linux-2.6.29.4/drivers/video/logo/Kconfig 2009-06-04 09:54:16.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/video/logo/Kconfig 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29.6/drivers/video/logo/Kconfig 2010-03-19 11:01:32.000000000 +0100
@@ -82,4 +82,11 @@
depends on M32R
default y
@@ -14,10 +14,10 @@ Index: linux-2.6.29.4/drivers/video/logo/Kconfig
+ Choose this if you want to have the Armadeus Tux as boot logo
+
endif # LOGO
-Index: linux-2.6.29.4/drivers/video/logo/logo_armadeus_clut224.ppm
+Index: linux-2.6.29.6/drivers/video/logo/logo_armadeus_clut224.ppm
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.4/drivers/video/logo/logo_armadeus_clut224.ppm 2009-06-04 09:54:16.000000000 +0200
++++ linux-2.6.29.6/drivers/video/logo/logo_armadeus_clut224.ppm 2010-03-19 11:01:32.000000000 +0100
@@ -0,0 +1,19205 @@
+P3
+# CREATOR: The GIMP's PNM Filter Version 1.0
@@ -19224,10 +19224,10 @@ Index: linux-2.6.29.4/drivers/video/logo/logo_armadeus_clut224.ppm
+0
+0
+0
-Index: linux-2.6.29.4/drivers/video/logo/logo.c
+Index: linux-2.6.29.6/drivers/video/logo/logo.c
===================================================================
---- linux-2.6.29.4.orig/drivers/video/logo/logo.c 2009-03-24 00:12:14.000000000 +0100
-+++ linux-2.6.29.4/drivers/video/logo/logo.c 2009-06-04 09:54:16.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/video/logo/logo.c 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29.6/drivers/video/logo/logo.c 2010-03-19 11:20:14.000000000 +0100
@@ -35,6 +35,7 @@
extern const struct linux_logo logo_superh_vga16;
extern const struct linux_logo logo_superh_clut224;
@@ -19241,21 +19241,21 @@ Index: linux-2.6.29.4/drivers/video/logo/logo.c
logo = &logo_m32r_clut224;
#endif
+#ifdef CONFIG_LOGO_ARMADEUS_CLUT224
-+ /* Armadeus Linux logo */
-+ logo = &logo_armadeus_clut224;
++ /* Armadeus Linux logo */
++ logo = &logo_armadeus_clut224;
+#endif
}
return logo;
}
-Index: linux-2.6.29.4/drivers/video/logo/Makefile
+Index: linux-2.6.29.6/drivers/video/logo/Makefile
===================================================================
---- linux-2.6.29.4.orig/drivers/video/logo/Makefile 2009-03-24 00:12:14.000000000 +0100
-+++ linux-2.6.29.4/drivers/video/logo/Makefile 2009-06-04 09:54:16.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/video/logo/Makefile 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29.6/drivers/video/logo/Makefile 2010-03-19 11:20:39.000000000 +0100
@@ -15,6 +15,7 @@
obj-$(CONFIG_LOGO_SUPERH_VGA16) += logo_superh_vga16.o
obj-$(CONFIG_LOGO_SUPERH_CLUT224) += logo_superh_clut224.o
obj-$(CONFIG_LOGO_M32R_CLUT224) += logo_m32r_clut224.o
-+obj-$(CONFIG_LOGO_ARMADEUS_CLUT224) += logo_armadeus_clut224.o
++obj-$(CONFIG_LOGO_ARMADEUS_CLUT224) += logo_armadeus_clut224.o
obj-$(CONFIG_SPU_BASE) += logo_spe_clut224.o
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-19 14:26:11
|
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 533811eb2bc49f0015b7caa1e9d300d1f7cc836e (commit)
from 272b2680ecafed37be03581fd04ae112960f13e3 (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 533811eb2bc49f0015b7caa1e9d300d1f7cc836e
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 19 15:25:39 2010 +0100
[BUILDROOT] toolchain/gcc: don't enable libssp support (as on BR mainline)
-----------------------------------------------------------------------
Summary of changes:
.../103-gcc-dont_enable_libssp_support.patch | 88 ++++++++++++++++++++
1 files changed, 88 insertions(+), 0 deletions(-)
create mode 100644 patches/buildroot/103-gcc-dont_enable_libssp_support.patch
diff --git a/patches/buildroot/103-gcc-dont_enable_libssp_support.patch b/patches/buildroot/103-gcc-dont_enable_libssp_support.patch
new file mode 100644
index 0000000..38253eb
--- /dev/null
+++ b/patches/buildroot/103-gcc-dont_enable_libssp_support.patch
@@ -0,0 +1,88 @@
+Not needed on BR > 2010.02
+
+From 3b712a3d891bf23055a587fc518f7cd2139a6a09 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <ja...@su...>
+Date: Wed, 22 Apr 2009 07:27:17 +0000
+Subject: toolchain/gcc: don't enable libssp support
+
+It's broken anyway as we don't install libssp* into TARGET_DIR, and we
+should use the SSP support in uClibc if we want stack protection.
+---
+diff --git a/toolchain/gcc/Makefile.in b/toolchain/gcc/Makefile.in
+index aaf4513..a1c5564 100644
+--- a/toolchain/gcc/Makefile.in
++++ b/toolchain/gcc/Makefile.in
+@@ -74,7 +74,6 @@ endif
+ ifeq ($(BR2_avr32),y)
+ EXTRA_GCC_CONFIG_OPTIONS+=--disable-libmudflap
+ SOFT_FLOAT_CONFIG_OPTION:=
+-EXTRA_GCC_CONFIG_OPTIONS+=--disable-libssp
+ EXTRA_GCC_CONFIG_OPTIONS+=--with-build-time-tools=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin \
+ #EXTRA_GCC_CONFIG_OPTIONS+=--with-as=$(TARGET_CROSS)as
+ endif
+@@ -90,7 +89,6 @@ EXTRA_TARGET_GCC_CONFIG_OPTIONS:=
+ # AVR32 target GCC configuration
+ ifeq ($(BR2_avr32),y)
+ EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--disable-libmudflap
+-EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--disable-libssp
+ EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--with-build-time-tools=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin \
+ EXTRA_TARGET_GCC_CONFIG_OPTIONS+=--with-as=$(TARGET_CROSS)as
+ endif
+diff --git a/toolchain/gcc/gcc-uclibc-3.x.mk b/toolchain/gcc/gcc-uclibc-3.x.mk
+index a734eef..131c9bd 100644
+--- a/toolchain/gcc/gcc-uclibc-3.x.mk
++++ b/toolchain/gcc/gcc-uclibc-3.x.mk
+@@ -181,6 +181,7 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
+ --enable-target-optspace \
+ --with-gnu-ld \
+ --disable-shared \
++ --disable-libssp \
+ $(GCC_WITH_HOST_GMP) \
+ $(GCC_WITH_HOST_MPFR) \
+ $(DISABLE_NLS) \
+@@ -246,6 +247,7 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(GCC_STAGING_PREREQ)
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
++ --disable-libssp \
+ $(GCC_WITH_HOST_GMP) \
+ $(GCC_WITH_HOST_MPFR) \
+ $(GCC_SHARED_LIBGCC) \
+@@ -396,6 +398,7 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared
+ --disable-__cxa_atexit \
+ --with-gnu-ld \
+ --with-gnu-as \
++ --disable-libssp \
+ $(GCC_SHARED_LIBGCC) \
+ $(GCC_WITH_TARGET_GMP) \
+ $(GCC_WITH_TARGET_MPFR) \
+diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
+index c8ca75e..749331f 100644
+--- a/toolchain/gcc/gcc-uclibc-4.x.mk
++++ b/toolchain/gcc/gcc-uclibc-4.x.mk
+@@ -205,6 +205,7 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
+ --enable-target-optspace \
+ --with-gnu-ld \
+ --disable-shared \
++ --disable-libssp \
+ $(GCC_WITH_HOST_GMP) \
+ $(GCC_WITH_HOST_MPFR) \
+ $(DISABLE_NLS) \
+@@ -279,6 +280,7 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_SRC_DIR)/.patched $(GCC_STAGING_PREREQ)
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
++ --disable-libssp \
+ $(GCC_SHARED_LIBGCC) \
+ $(GCC_WITH_HOST_GMP) \
+ $(GCC_WITH_HOST_MPFR) \
+@@ -407,6 +409,7 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared
+ --with-gxx-include-dir=/usr/include/c++ \
+ --disable-__cxa_atexit \
+ --with-gnu-ld \
++ --disable-libssp \
+ $(GCC_SHARED_LIBGCC) \
+ $(GCC_WITH_TARGET_GMP) \
+ $(GCC_WITH_TARGET_MPFR) \
+--
+cgit v0.8.2.1
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-19 09:34:37
|
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 272b2680ecafed37be03581fd04ae112960f13e3 (commit)
from 17ccf2b88b5aefd5e34263957f6636621bd4d442 (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 272b2680ecafed37be03581fd04ae112960f13e3
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 19 10:33:57 2010 +0100
[BUILDROOT] Updates Imagemagick package to latest BR state
-----------------------------------------------------------------------
Summary of changes:
...emagick-updates_to_latest_buildroot_state.patch | 138 ++++++++++++++++++++
1 files changed, 138 insertions(+), 0 deletions(-)
create mode 100644 patches/buildroot/102-imagemagick-updates_to_latest_buildroot_state.patch
diff --git a/patches/buildroot/102-imagemagick-updates_to_latest_buildroot_state.patch b/patches/buildroot/102-imagemagick-updates_to_latest_buildroot_state.patch
new file mode 100644
index 0000000..38ccba2
--- /dev/null
+++ b/patches/buildroot/102-imagemagick-updates_to_latest_buildroot_state.patch
@@ -0,0 +1,138 @@
+Apply all Buildroot changes until Feb 23th 2010.
+
+Only needed for Buildroot < 2010.02
+
+Index: buildroot/package/imagemagick/imagemagick.mk
+===================================================================
+--- buildroot.orig/package/imagemagick/imagemagick.mk 2010-03-18 21:01:41.000000000 +0100
++++ buildroot/package/imagemagick/imagemagick.mk 2010-03-19 09:09:52.000000000 +0100
+@@ -3,14 +3,13 @@
+ # imagemagick
+ #
+ #############################################################
+-IMAGEMAGICK_VERSION:=6.3.7
+-IMAGEMAGICK_SOURCE:=ImageMagick.tar.bz2
++IMAGEMAGICK_MAJOR:=6.4.8
++IMAGEMAGICK_VERSION:=$(IMAGEMAGICK_MAJOR)-4
++IMAGEMAGICK_SOURCE:=ImageMagick-$(IMAGEMAGICK_VERSION).tar.bz2
+ IMAGEMAGICK_SITE:=ftp://ftp.imagemagick.org/pub/ImageMagick
+ IMAGEMAGICK_DIR:=$(BUILD_DIR)/ImageMagick-$(IMAGEMAGICK_VERSION)
+ IMAGEMAGICK_CAT:=$(BZCAT)
+-#IMAGEMAGICK_BINARY:=convert
+-#IMAGEMAGICK_TARGET_BINARY:=usr/bin/$(IMAGEMAGICK_BINARY)
+-IMAGEMAGICK_LIB:=$(TARGET_DIR)/usr/lib/libMagick.so
++IMAGEMAGICK_LIB:=$(TARGET_DIR)/usr/lib/libMagickCore.so
+
+ IMAGEMAGICK_TARGET_BINARIES:=$(TARGET_DIR)/usr/bin/animate
+ IMAGEMAGICK_TARGET_BINARIES+=$(TARGET_DIR)/usr/bin/compare
+@@ -24,19 +23,25 @@
+
+ IMAGEMAGICK_COPY:=cp -df --preserve=mode,ownership
+ $(DL_DIR)/$(IMAGEMAGICK_SOURCE):
+- $(WGET) -P $(DL_DIR) $(IMAGEMAGICK_SITE)/$(IMAGEMAGICK_SOURCE)
++ $(call DOWNLOAD,$(IMAGEMAGICK_SITE),$(IMAGEMAGICK_SOURCE))
+
+ $(IMAGEMAGICK_DIR)/.unpacked: $(DL_DIR)/$(IMAGEMAGICK_SOURCE)
+ $(IMAGEMAGICK_CAT) $(DL_DIR)/$(IMAGEMAGICK_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+- toolchain/patch-kernel.sh $(IMAGEMAGICK_DIR) package/imagemagick/ imagemagick-\*.patch\*
++ toolchain/patch-kernel.sh $(IMAGEMAGICK_DIR) package/imagemagick/ imagemagick-$(IMAGEMAGICK_VERSION)\*.patch\*
+ $(CONFIG_UPDATE) $(IMAGEMAGICK_DIR)/config
+ touch $@
+
++ifeq ($(BR2_LARGEFILE),y)
++IMAGEMAGICK_CONF_OPTS = ac_cv_sys_file_offset_bits=64
++else
++IMAGEMAGICK_CONF_OPTS = ac_cv_sys_file_offset_bits=32
++endif
++
+ $(IMAGEMAGICK_DIR)/.configured: $(IMAGEMAGICK_DIR)/.unpacked
+ (cd $(IMAGEMAGICK_DIR); rm -f config.cache; \
+ $(TARGET_CONFIGURE_OPTS) \
+ $(TARGET_CONFIGURE_ARGS) \
+- ./configure \
++ ./configure $(QUIET) \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+@@ -56,6 +61,7 @@
+ --without-fpx \
+ --without-freetype \
+ --without-x \
++ $(IMAGEMAGICK_CONF_OPTS) \
+ )
+ touch $@
+
+@@ -63,22 +69,22 @@
+ $(MAKE) -C $(IMAGEMAGICK_DIR)
+ touch $@
+
+-$(STAGING_DIR)/usr/lib/libMagick.a: $(IMAGEMAGICK_DIR)/.compiled
++$(STAGING_DIR)/usr/lib/libMagickCore.a: $(IMAGEMAGICK_DIR)/.compiled
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(IMAGEMAGICK_DIR) install
+ touch -c $@
+
+-$(IMAGEMAGICK_LIB): $(STAGING_DIR)/usr/lib/libMagick.a
+- $(IMAGEMAGICK_COPY) $(STAGING_DIR)/usr/lib/libWand.so* $(TARGET_DIR)/usr/lib/
+- -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libWand.so*
+- mkdir -p $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_VERSION)
+- $(IMAGEMAGICK_COPY) -r $(STAGING_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_VERSION) $(TARGET_DIR)/usr/lib
+- $(IMAGEMAGICK_COPY) $(STAGING_DIR)/usr/lib/libMagick.so* $(TARGET_DIR)/usr/lib/
++$(IMAGEMAGICK_LIB): $(STAGING_DIR)/usr/lib/libMagickCore.a
++ $(IMAGEMAGICK_COPY) $(STAGING_DIR)/usr/lib/libMagickWand.so* $(TARGET_DIR)/usr/lib/
++ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libMagickWand.so*
++ mkdir -p $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_MAJOR)
++ $(IMAGEMAGICK_COPY) -r $(STAGING_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_MAJOR) $(TARGET_DIR)/usr/lib
++ $(IMAGEMAGICK_COPY) $(STAGING_DIR)/usr/lib/libMagickCore.so* $(TARGET_DIR)/usr/lib/
+ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(IMAGEMAGICK_LIB)*
+ touch -c $@
+
+ $(IMAGEMAGICK_DIR)/.libinstall: $(IMAGEMAGICK_LIB)
+- libtool --finish $(TARGET_DIR)/usr/lib/ImageMagick-6.3.5/modules-Q16/coders
+- libtool --finish $(TARGET_DIR)/usr/lib/ImageMagick-6.3.5/modules-Q16/filters
++ $(IMAGEMAGICK_DIR)/libtool --finish $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_MAJOR)/modules-Q16/coders
++ $(IMAGEMAGICK_DIR)/libtool --finish $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_MAJOR)/modules-Q16/filters
+ touch $@
+
+ $(TARGET_DIR)/usr/bin/animate: $(IMAGEMAGICK_LIB)
+@@ -127,25 +133,20 @@
+ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/bin/convert
+ touch $@
+
+-imagemagick: uclibc jpeg tiff $(IMAGEMAGICK_LIB) \
++imagemagick: jpeg tiff $(IMAGEMAGICK_LIB) \
+ $(IMAGEMAGICK_DIR)/.libinstall \
+ $(IMAGEMAGICK_TARGET_BINARIES)
+
+ imagemagick-source: $(DL_DIR)/$(IMAGEMAGICK_SOURCE)
+
++imagemagick-unpacked:$(IMAGEMAGICK_DIR)/.unpacked
++
+ imagemagick-clean:
+- rm -f $(TARGET_DIR)/$(IMAGEMAGICK_TARGET_BINARY)
+- rm -f $(TARGET_DIR)/usr/bin/animate
+- rm -f $(TARGET_DIR)/usr/bin/compare
+- rm -f $(TARGET_DIR)/usr/bin/composite
+- rm -f $(TARGET_DIR)/usr/bin/conjure
+- rm -f $(TARGET_DIR)/usr/bin/convert
+- rm -f $(TARGET_DIR)/usr/bin/display
+- rm -f $(TARGET_DIR)/usr/bin/import
+- rm -f $(TARGET_DIR)/usr/bin/mogrify
+- rm -f $(TARGET_DIR)/usr/bin/montage
+- rm -rf $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_VERSION)
+- rm -rf $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_VERSION)
++ for target_binary in $(IMAGEMAGICK_TARGET_BINARIES); do \
++ rm -f $$target_binary; \
++ done
++ rm -rf $(TARGET_DIR)/usr/lib/libMagick*
++ rm -rf $(TARGET_DIR)/usr/lib/ImageMagick-$(IMAGEMAGICK_MAJOR)
+ -$(MAKE) -C $(IMAGEMAGICK_DIR) clean
+
+ imagemagick-dirclean:
+@@ -155,6 +156,6 @@
+ # Toplevel Makefile options
+ #
+ #############################################################
+-ifeq ($(strip $(BR2_PACKAGE_IMAGEMAGICK)),y)
++ifeq ($(BR2_PACKAGE_IMAGEMAGICK),y)
+ TARGETS+=imagemagick
+ endif
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-18 15:57: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 17ccf2b88b5aefd5e34263957f6636621bd4d442 (commit)
via c8d8b8571e91d7c5f394aa83d1a78693b866c7fd (commit)
via 1383d69b3440c1cb5e5a8b2bcd2829c311575807 (commit)
via 59487a64ccd11fbc1ee8815145c697a18e1bca51 (commit)
via e6e6e857d141e1fee87806fb6d72bd90f7d9759e (commit)
from 927b7a7bb2772e43c3c6d50d769ed9e8e09e3424 (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 17ccf2b88b5aefd5e34263957f6636621bd4d442
Author: Julien Boibessot <jul...@ar...>
Date: Thu Mar 18 16:56:49 2010 +0100
[TESTS] Transform test_pwm.sh in a release test
commit c8d8b8571e91d7c5f394aa83d1a78693b866c7fd
Author: Julien Boibessot <jul...@ar...>
Date: Thu Mar 18 16:31:28 2010 +0100
[TESTS] Move test_pwm.sh to the test scripts dir
commit 1383d69b3440c1cb5e5a8b2bcd2829c311575807
Author: Julien Boibessot <jul...@ar...>
Date: Thu Mar 18 16:28:58 2010 +0100
[TESTS] Rename testpwm.sh to test_pwm.sh
commit 59487a64ccd11fbc1ee8815145c697a18e1bca51
Author: Julien Boibessot <jul...@ar...>
Date: Thu Mar 18 13:27:45 2010 +0100
[LINUX] Cleanup PWM driver & add automatic /dev creation
commit e6e6e857d141e1fee87806fb6d72bd90f7d9759e
Author: Julien Boibessot <jul...@ar...>
Date: Wed Mar 17 11:52:43 2010 +0100
[DEMOS] Cleanup in oscillo & real_time/fractal
-----------------------------------------------------------------------
Summary of changes:
target/demos/oscillo/lcd.c | 10 -
target/demos/real_time/fractal/lcd.c | 10 -
target/linux/modules/pwm/pwm.c | 415 ++++++++++-------------------
target/linux/modules/pwm/pwm.h | 94 ++++----
target/linux/modules/pwm/test/test_pwm.sh | 1 +
target/linux/modules/pwm/test/testpwm.sh | 47 ----
target/test/test_pwm.sh | 92 +++++++
target/test/test_release.sh | 2 +
8 files changed, 280 insertions(+), 391 deletions(-)
create mode 120000 target/linux/modules/pwm/test/test_pwm.sh
delete mode 100755 target/linux/modules/pwm/test/testpwm.sh
create mode 100755 target/test/test_pwm.sh
diff --git a/target/demos/oscillo/lcd.c b/target/demos/oscillo/lcd.c
index db1e0c7..cb5ea5d 100644
--- a/target/demos/oscillo/lcd.c
+++ b/target/demos/oscillo/lcd.c
@@ -21,26 +21,16 @@
*
*/
-
#include <errno.h>
-
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-
#include <sys/ioctl.h>
#include <sys/time.h>
-#include <unistd.h>
-#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
-#include <sys/mman.h>
#include "lcd.h"
diff --git a/target/demos/real_time/fractal/lcd.c b/target/demos/real_time/fractal/lcd.c
index d6072be..534428e 100644
--- a/target/demos/real_time/fractal/lcd.c
+++ b/target/demos/real_time/fractal/lcd.c
@@ -21,26 +21,16 @@
*
*/
-
#include <errno.h>
-
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-
#include <sys/ioctl.h>
#include <sys/time.h>
-#include <unistd.h>
-#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
-#include <sys/mman.h>
#include "lcd.h"
diff --git a/target/linux/modules/pwm/pwm.c b/target/linux/modules/pwm/pwm.c
index 2fca2ad..82c686e 100644
--- a/target/linux/modules/pwm/pwm.c
+++ b/target/linux/modules/pwm/pwm.c
@@ -21,25 +21,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
#include <linux/module.h>
#include <linux/version.h>
-#include <linux/init.h>
#include <linux/fs.h>
#include <linux/delay.h>
-#include <linux/poll.h>
-#include <asm/uaccess.h> /* get_user,copy_to_user */
+#include <asm/uaccess.h> /* get_user, copy_to_user */
#include <linux/miscdevice.h>
-
-#include <linux/string.h>
-#include <linux/kernel.h>
#include <linux/timer.h>
-#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/string.h>
#include <asm/io.h>
#include <mach/hardware.h>
#include <linux/errno.h>
@@ -47,8 +39,7 @@
#include <linux/pm.h>
#include <linux/clk.h>
#include <linux/sysdev.h>
-/* For struct class */
-#include <linux/device.h>
+#include <linux/device.h> /* struct class */
#include <linux/circ_buf.h>
#include <linux/platform_device.h>
@@ -119,10 +110,8 @@
#endif
#define DRIVER_NAME "imx-pwm"
-#define DRIVER_VERSION "0.7"
+#define DRIVER_VERSION "0.8"
-//#define PK(fmt, args...) printk(fmt, ## args)
-#define PK(...)
struct sound_circ_buf {
char* buf;
@@ -142,18 +131,16 @@ typedef struct timerStruct
int stop_flag;
} pwm_timer_t;
-
-struct pwm_table {
- u32 period; /* in us */
- u32 prescaler;
-};
-
struct pwm_device {
- unsigned long membase;
+ void __iomem *membase;
unsigned int irq;
+
int active;
- unsigned duty;
- /*const*/ struct pwm_table entry;
+ unsigned int duty; /* current duty cycle in % x 10 */
+ unsigned int frequency; /* current frequency in Hz */
+ u16 prescaler;
+ u16 period_reg; /* value to put in PWMPR register to have requested freq */
+
int mode;
int nbbytes; /* count 4 bytes write occurence to FIFO */
int dataLen;
@@ -167,23 +154,21 @@ struct pwm_device {
timer_blk_t timer_blk;
struct clk *clk;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
- struct class_device class_dev;
-#else
- struct device class_dev;
-#endif
+ struct device *dev;
};
int gMajor = 0;
-static struct pwm_device *dev_table[PWM_MAX_DEV];
-static struct class pwm_class; /* forward declaration only */
+static struct pwm_device *dev_table[PWM_MAX_DEV];
+static struct class *pwm_class; /* forward declaration only */
-#define to_pwm_device(d) container_of(d, struct pwm_device, class_dev)
+static void inline unregister_sys_file(struct pwm_device *pwm);
-//struct fasync_struct *ts_fasync;
+/*
+struct fasync_struct *ts_fasync;
+*/
/****************************************************************
- * Circular buffer handling four sound playing
+ * Circular buffer handling for sound playing
***************************************************************/
static inline u8 get_byte_from_circbuf(struct sound_circ_buf* abuffer)
@@ -214,6 +199,7 @@ static inline void increase_circbuf(struct sound_circ_buf* abuffer, int count)
pr_debug("Added %d bytes to buffer, now write is in pos %d\n", count, abuffer->write);
}
+
static int get_current_pwm_clk_rate(struct pwm_device *pwm)
{
if ((readl(pwm->membase + PWMCTRL) & PWM_CLKSRC_MASK) == PWM_CLKSRC_32K)
@@ -243,26 +229,21 @@ static void compute_pwm_params(u32 req_freq, struct pwm_device *pwm)
u32 input_freq, divider;
input_freq = get_current_pwm_clk_rate(pwm);
-// printk("input freq, %x %x\n", input_freq, req_freq);
+ pr_debug("input freq, %d %d\n", input_freq, req_freq);
divider = ((input_freq*10)/req_freq+5)/10;
if (divider/65536) {
- pwm->entry.prescaler = divider/65536 +1;
- pwm->entry.period = input_freq/(pwm->entry.prescaler*req_freq)-2;
+ pwm->prescaler = (divider/65536)+1;
+ pwm->period_reg = input_freq/(pwm->prescaler*req_freq)-2;
} else {
- pwm->entry.period = divider-2;
- pwm->entry.prescaler = 1;
+ pwm->period_reg = divider-2;
+ pwm->prescaler = 1;
}
+ pwm->frequency = req_freq;
+ pr_debug("period: %d prescaler: %d\n", pwm->period_reg, pwm->prescaler);
}
-/****************************************************************
- *
- ***************************************************************/
-
-static void inline unregister_sys_file( struct pwm_device *pwm );
-
-
-static void write_bits(u32 bit, u32 mask, unsigned long reg)
+static void write_bits(u32 bit, u32 mask, void __iomem *reg)
{
u32 temp;
temp = readl(reg) & ~mask;
@@ -273,21 +254,17 @@ static void setup_pwm_params(struct pwm_device *pwm)
{
write_bits(PWM_CLKSRC_IPG, PWM_CLKSRC_MASK, pwm->membase + PWMCTRL);
/* Setup prescaler */
- pr_debug("Updating PWM registers\n");
- write_bits(PWM_PRESCALER(pwm->entry.prescaler),
+ write_bits(PWM_PRESCALER(pwm->prescaler),
PWM_PRESCALER_MASK, pwm->membase + PWMCTRL); /*| PWMC_REPEAT(3)*/;
/* Setup period */
- writel(PWM_PERIOD(pwm->entry.period), pwm->membase + PWMPERIOD);
+ writel(PWM_PERIOD(pwm->period_reg), pwm->membase + PWMPERIOD);
/* Setup duty cycle */
- writel(PWM_SAMPLE((u32)((pwm->entry.period * pwm->duty) / 1000)),
+ writel(PWM_SAMPLE((u32)((pwm->period_reg * pwm->duty) / 1000)),
pwm->membase + PWMSAMPLE);
}
-/**
- * setup_pwm_unit - common setup function whenever something was changed
- * @pwm: PWM unit to work with
- */
+/* common setup function whenever something was changed */
static void setup_pwm_unit(struct pwm_device *pwm)
{
if (pwm->active) {
@@ -309,6 +286,7 @@ static int create_timer(pwm_timer_t *timer)
return 0;
}
+#if 0
static int start_timer(pwm_timer_t *timer)
{
timer->timer_blk_ptr->expires = jiffies + timer->period;
@@ -318,6 +296,7 @@ static int start_timer(pwm_timer_t *timer)
return 0;
}
+#endif
static int stop_timer(pwm_timer_t *timer)
{
@@ -339,15 +318,15 @@ static void stop_pwm(struct pwm_device *pwm)
/* Can release file now */
wake_up_interruptible(&pwm->exit_wait);
- PK("<1>data completed.\n");
- PK("<1>PWMC = 0x%8x\n", readl(pwm->membase + PWMCTRL));
+ pr_debug("data completed.\n");
+ pr_debug("PWMC = 0x%8x\n", readl(pwm->membase + PWMCTRL));
}
static void pwmIntFunc( unsigned long unused)
{
// u32 period;
- PK("<1>pwm sam int\n");
+ pr_debug("pwm sam int\n");
// if (gWriteCnt > 0)
// {
@@ -383,13 +362,14 @@ static int init_pwm(struct pwm_device *pwm)
return 1;
}
-//////////////////////////////////////// /DEV INTERFACE ////////////////////////////////////////////
+
+/* /DEV INTERFACE */
int pwm_release(struct inode * inode, struct file * filp)
{
struct pwm_device *pwm = dev_table[iminor(inode)];
- // wait unit gWriteCnt == 0
+ /* wait unit gWriteCnt == 0 */
interruptible_sleep_on(&pwm->exit_wait);
if (pwm->mode == PWM_PLAY_MODE) {
/* disable IRQ */
@@ -423,7 +403,7 @@ int pwm_open(struct inode * inode, struct file * filp)
static int pwm_fasync(int fd, struct file *filp, int mode)
{
- PK("<1>in pwm_fasyn ----\n");
+ pr_debug("in pwm_fasyn ----\n");
#if 0
/* TODO TODO put this data into file private data */
int minor = checkDevice( filp->f_dentry->d_inode);
@@ -435,7 +415,7 @@ static int pwm_fasync(int fd, struct file *filp, int mode)
return( fasync_helper(fd, filp, mode, &ts_fasync) );
#endif
- return 0;
+ return 0;
}
int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigned long arg)
@@ -444,9 +424,7 @@ int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigne
int ret = 0;
struct pwm_device *pwm = dev_table[iminor(inode)];
- pr_debug("pwm_ioctl ----\n");
- switch(cmd)
- {
+ switch (cmd) {
/* Set PWM Mode (Tone or Playback) */
case PWM_IOC_SMODE:
{
@@ -528,7 +506,7 @@ int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigne
case PWM_IOC_SPERIOD:
if (pwm->mode == PWM_TONE_MODE) {
- PK("<1>PWM period = %d\n",(int)arg);
+ pr_debug("PWM period = %d\n", (int)arg);
pwm->timer.period = arg/12;
}
break;
@@ -570,8 +548,6 @@ ssize_t pwm_read(struct file * filp, char * buf, size_t count, loff_t * l)
else
ret = 0; /* processing data */
- pr_debug("pwm_read ----\n");
-
return ret;
}
@@ -582,8 +558,6 @@ static ssize_t pwm_write( struct file *filp, const char *buf, size_t count, loff
struct pwm_device *pwm = dev_table[iminor(filp->f_dentry->d_inode)];
struct sound_circ_buf *circ = &pwm->circ_buf;
- pr_debug("pwm_write ----\n");
-
if (count > MAX_SOUND_BUFFER_SIZE)
count = MAX_SOUND_BUFFER_SIZE;
/* First time, allocate the double buffer */
@@ -661,32 +635,22 @@ struct file_operations pwm_fops = {
fasync: pwm_fasync
};
-/////////////////////////////////////// END OF /DEV INTERFACE /////////////////////////////////////////////////////////
+/* END OF /DEV INTERFACE */
-/**
- * pwm_show_duty - return current duty setting
- * @dev: device to work with
- * @buf: space to write the current value in
- */
+/* /sys interface: */
+
static ssize_t pwm_show_duty(struct device *dev, struct device_attribute *attr, char *buf)
{
ssize_t ret_size = 0;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
- ret_size=sprintf(buf, "%u", pwm->duty);
+ ret_size = sprintf(buf, "%u", pwm->duty);
return ret_size;
}
-/**
- * pwm_store_duty - set new duty
- * @dev: device to work with
- * @buf: buffer with new value in ASCII
- * @size: size of buffer
- *
- * Returns the given @size or -EIO
- *
+/*
* Duty value can be 0 ... 1000. Without floating point you can take
* one position after decimal point into account. The internal counters
* supports 10 bit resolution, so it makes sense to support such a thing
@@ -695,7 +659,7 @@ static ssize_t pwm_show_duty(struct device *dev, struct device_attribute *attr,
static ssize_t pwm_store_duty(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
long value;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
value = simple_strtol(buf, NULL, 10);
if ((value < 1) || (value > 999))
@@ -707,34 +671,23 @@ static ssize_t pwm_store_duty(struct device *dev, struct device_attribute *attr,
return size;
}
-/**
- * pwm_show_period - return current period setting
- * @dev: device to work with
- * @buf: space to write the current value in
- */
static ssize_t pwm_show_period(struct device *dev, struct device_attribute *attr, char *buf)
{
ssize_t ret_size = 0;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
- ret_size = sprintf(buf, "%d", pwm->entry.period);
+ if (pwm->frequency)
+ ret_size = sprintf(buf, "%d", (u32) 1000000/(pwm->frequency));
+ else
+ ret_size = sprintf(buf, "0");
return ret_size;
}
-/**
- * pwm_store_period - set new period setting
- * @dev: device to work with
- * @buf: buffer with new value in ASCII
- * @size: size of buffer
- *
- * Returns the given @size or -EIO
- */
-
static ssize_t pwm_store_period(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
- long value/*,i*/;
- struct pwm_device *pwm = to_pwm_device(dev);
+ long value;
+ struct pwm_device *pwm = dev_get_drvdata(dev);
value = simple_strtol(buf, NULL, 10); /* in us */
if ((value < (1000000/get_pwm_max_freq(pwm))) || (value > (1000000/get_pwm_min_freq(pwm))))
@@ -746,40 +699,24 @@ static ssize_t pwm_store_period(struct device *dev, struct device_attribute *att
return size;
}
-/**
- * pwm_show_frequency - return current frequency setting
- * @dev: device to work with
- * @buf: space to write the current value in
- */
static ssize_t pwm_show_frequency(struct device *dev, struct device_attribute *attr, char *buf)
{
ssize_t ret_size = 0;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
- if (pwm->entry.period)
- ret_size = sprintf(buf, "%d", (u32) 1000000/(pwm->entry.period));
- else
- ret_size = sprintf(buf, "0");
+ ret_size = sprintf(buf, "%d", pwm->frequency);
return ret_size;
}
-/**
- * pwm_store_frequency - set new frequency setting
- * @dev: device to work with
- * @buf: buffer with new value in ASCII
- * @size: size of buffer
- *
- * Returns the given @size or -EIO
- *
- * The unit of the given value should be in Hertz and the value
- * between 2 and 100k.
+/*
+ * Given value (in Hertz) should be between 2 and 100k
*/
static ssize_t pwm_store_frequency(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
long value;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
value = simple_strtol(buf, NULL, 10);
if ((value < get_pwm_min_freq(pwm)) || (value > get_pwm_max_freq(pwm)))
@@ -791,33 +728,20 @@ static ssize_t pwm_store_frequency(struct device *dev, struct device_attribute *
return size;
}
-/**
- * pwm_show_state - return current state setting
- * @dev: device to work with
- * @buf: space to write the current value in
- */
static ssize_t pwm_show_state(struct device *dev, struct device_attribute *attr, char *buf)
{
ssize_t ret_size = 0;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
ret_size = sprintf(buf, "%d", pwm->active);
return ret_size;
}
-/**
- * pwm_store_state - set new state setting
- * @dev: device to work with
- * @buf: buffer with new value in ASCII
- * @size: size of buffer
- *
- * Returns the given @size
- */
static ssize_t pwm_store_state(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
long value;
- struct pwm_device *pwm = to_pwm_device(dev);
+ struct pwm_device *pwm = dev_get_drvdata(dev);
value = simple_strtol(buf, NULL, 10);
if (value != 0)
@@ -830,29 +754,13 @@ static ssize_t pwm_store_state(struct device *dev, struct device_attribute *attr
return size;
}
-
-/*
- * Attribute: /sys/class/pwm/pwmX/duty
- * dev_attr_duty
- */
+/* dev_attr_duty /class/pwm/pwmX/duty */
static DEVICE_ATTR(duty, S_IWUSR | S_IRUGO, pwm_show_duty, pwm_store_duty);
-
-/*
- * Attribute: /sys/class/pwm/pwmX/period
- * dev_attr_period
- */
+/* dev_attr_period /sys/class/pwm/pwmX/period */
static DEVICE_ATTR(period, S_IWUSR | S_IRUGO, pwm_show_period, pwm_store_period);
-
-/*
- * Attribute: /sys/class/pwm/pwmX/frequency
- * dev_attr_frequency
- */
+/* dev_attr_frequency /sys/class/pwm/pwmX/frequency */
static DEVICE_ATTR(frequency, S_IWUSR | S_IRUGO, pwm_show_frequency, pwm_store_frequency);
-
-/*
- * Attribute: /sys/class/pwm/pwmX/active
- * dev_attr_active
- */
+/* dev_attr_active /sys/class/pwm/pwmX/active */
static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, pwm_show_state, pwm_store_state);
@@ -861,7 +769,9 @@ static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, pwm_show_state, pwm_store_state);
*/
static irqreturn_t pwm_interrupt(int irq, void *dev_id)
{
+#ifndef CONFIG_ARCH_MX2
u32 status;
+#endif
int remaining = 0;
struct pwm_device *pwm = (struct pwm_device *) dev_id;
@@ -882,13 +792,13 @@ static irqreturn_t pwm_interrupt(int irq, void *dev_id)
if (pwm->dataLen == PWM_DATA_8BIT) {
while (remaining) {
writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
- /*PK("<1>(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS);*/
+ /*pr_debug("(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS);*/
remaining--;
}
} else { /* PWM_DATA_16BIT) */
while (remaining) {
writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
- //PK("<1>(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS);
+ /*pr_debug("(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS); */
remaining--;
}
}
@@ -911,7 +821,7 @@ static irqreturn_t pwm_interrupt(int irq, void *dev_id)
}
#endif
} else { /* PWM_DATA_16BIT) */
- // TODO: put good value in PWMC_BCTR to auto swap bytes if needed (do it at write or ioctl)
+ /* TODO: put good value in PWMC_BCTR to auto swap bytes if needed (do it at write or ioctl) */
writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
@@ -925,80 +835,76 @@ end:
return IRQ_HANDLED;
}
-/**
- * imx_pwm_drv_probe - claim resources
- * @pdev: platform device to work with
- */
static int imx_pwm_drv_probe(struct platform_device *pdev)
{
- int err=-ENODEV;
+ int err = -ENODEV;
struct resource *res;
struct pwm_device *pwm;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
- printk(KERN_INFO "Initializing PWM%u...", pdev->id);
-
if (pdev->id >= PWM_MAX_DEV)
- printk(DRIVER_NAME " failed. Unknown PWM%u device. Remember that this device only supports %d PWM\n", pdev->id, PWM_MAX_DEV);
+ dev_err(&pdev->dev, "failed. Unknown module. Remember that this device only supports %d PWM\n", PWM_MAX_DEV);
if (dev_table[pdev->id] != NULL) {
- printk(KERN_ERR ": already used\n");
+ dev_err(&pdev->dev, "already in use\n");
return -ENODEV;
}
if (!pdata) {
- printk(KERN_ERR "Platform data not supplied\n");
+ dev_err(&pdev->dev, "platform data not supplied\n");
return -ENOENT;
}
- if (unlikely((pwm = kmalloc(sizeof(struct pwm_device), GFP_KERNEL)) == NULL)) {
+ pwm = kmalloc(sizeof(struct pwm_device), GFP_KERNEL);
+ if (!pwm) {
return -ENOMEM;
}
- memset(&pwm->class_dev, 0, sizeof(struct device));
- pwm->class_dev.class = &pwm_class;
- pwm->class_dev.parent = &pdev->dev;
- snprintf(pwm->class_dev.bus_id, BUS_ID_SIZE, "pwm%i", pdev->id);
pwm->active = 0;
pwm->duty = 500; /* = 50.O% */
- pdev->dev.driver_data = pwm;
+ pwm->frequency = 0;
+ platform_set_drvdata(pdev, pwm);
dev_table[pdev->id] = pwm;
pwm->irq = platform_get_irq(pdev, 0);
if (pwm->irq < 0) {
- printk(KERN_ERR "No interrupt defined\n");
+ dev_err(&pdev->dev, "no interrupt defined\n");
err = -ENOENT;
goto error_malloc;
}
- if (unlikely(!(res = platform_get_resource(pdev, IORESOURCE_MEM, 0)))) {
- printk(KERN_ERR "Unable to get mem ressource\n");
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "unable to get mem ressource\n");
err = -ENOENT;
goto error_malloc;
}
if (unlikely(!request_mem_region(res->start, res->end - res->start + 1, DRIVER_NAME))) {
- printk(KERN_ERR "Region busy\n");
+ dev_err(&pdev->dev, "mem region busy\n");
err = -EBUSY;
goto error_malloc;
}
- /* TODO: use iomap() */
- pwm->membase = (unsigned long) IO_ADDRESS(res->start);
+ pwm->membase = ioremap(res->start, resource_size(res));
+ if (!pwm->membase) {
+ err = -ENOMEM;
+ goto error_memreg;
+ }
/* Register our char device */
err = register_chrdev(gMajor, DRIVER_NAME, &pwm_fops);
if (err < 0) {
- printk(KERN_ERR "pwm driver: Unable to register driver\n");
- goto error_memreg;
+ dev_err(&pdev->dev, "unable to register char driver\n");
+ goto error_iounmap;
}
/* Dynamic Major allocation */
if (gMajor == 0) {
gMajor = err;
- printk("PWM major number = %d\n", gMajor);
+ dev_dbg(&pdev->dev, "major = %d\n", gMajor);
}
err = request_irq(pwm->irq, pwm_interrupt, IRQF_DISABLED, DRIVER_NAME, pwm);
if (err) {
- printk(KERN_ERR "<1>cannot init major= %d irq=%d\n", gMajor, pwm->irq);
+ dev_err(&pdev->dev, "can't reserve irq=%d\n", pwm->irq);
goto error_chrdev;
}
@@ -1010,24 +916,29 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
if (pdata->init)
pdata->init();
- /* Create /sys stuf */
- err = device_register(&pwm->class_dev);
- if (unlikely(err)) goto error_irq;
+ /* Create /dev */
+ pwm->dev = device_create(pwm_class, NULL, MKDEV(gMajor, pdev->id), NULL, "pwm%i", pdev->id);
+ if (IS_ERR(pwm->dev)) {
+ err = PTR_ERR(pwm->dev);
+ dev_err(&pdev->dev, "can't create device\n");
+ goto error_platform_init;
+ }
+ dev_set_drvdata(pwm->dev, pwm);
/* Register the attributes */
- err |= device_create_file(&pwm->class_dev, &dev_attr_duty);
- if (unlikely(err)) goto error_register;
- err |= device_create_file(&pwm->class_dev, &dev_attr_period);
+ err |= device_create_file(pwm->dev, &dev_attr_duty);
+ if (unlikely(err)) goto error_dev_create;
+ err |= device_create_file(pwm->dev, &dev_attr_period);
if (unlikely(err)) goto error_file;
- err |= device_create_file(&pwm->class_dev, &dev_attr_frequency);
+ err |= device_create_file(pwm->dev, &dev_attr_frequency);
if (unlikely(err)) goto error_file;
- err |= device_create_file(&pwm->class_dev, &dev_attr_active);
+ err |= device_create_file(pwm->dev, &dev_attr_active);
if (unlikely(err)) goto error_file;
#ifdef CONFIG_ARCH_MX2
pwm->clk = clk_get(&pdev->dev, "pwm_clk");
if (IS_ERR(pwm->clk)) {
- printk(KERN_ERR "probe - cannot get clock\n");
+ dev_err(&pdev->dev, "can't get clock\n");
goto error_file;
}
clk_enable(pwm->clk);
@@ -1035,46 +946,47 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
/* init PWM hardware module */
init_pwm(pwm);
- printk("i.MX PWM driver v" DRIVER_VERSION "\n");
+ dev_info(&pdev->dev, "initialized\n");
return 0;
error_file:
- printk(KERN_ERR "%s: class /sys file creation failed\n", DRIVER_NAME);
+ dev_err(&pdev->dev, "class /sys file creation failed\n");
unregister_sys_file(pwm);
-error_register:
- device_unregister(&pwm->class_dev);
-error_irq:
+error_dev_create:
+ device_destroy(pwm_class, MKDEV(gMajor, pdev->id));
+error_platform_init:
+ if (pdata->exit)
+ pdata->exit();
free_irq(pwm->irq, pwm);
error_chrdev:
unregister_chrdev(gMajor, DRIVER_NAME);
+error_iounmap:
+ iounmap(pwm->membase);
error_memreg:
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
error_malloc:
kfree(pwm);
+
return err;
}
static inline void unregister_sys_file(struct pwm_device *pwm)
{
/* Unregister /sys attributes */
- device_remove_file(&pwm->class_dev, &dev_attr_active);
- device_remove_file(&pwm->class_dev, &dev_attr_period);
- device_remove_file(&pwm->class_dev, &dev_attr_frequency);
- device_remove_file(&pwm->class_dev, &dev_attr_duty);
+ device_remove_file(pwm->dev, &dev_attr_active);
+ device_remove_file(pwm->dev, &dev_attr_period);
+ device_remove_file(pwm->dev, &dev_attr_frequency);
+ device_remove_file(pwm->dev, &dev_attr_duty);
}
-/**
- * imx_pwm_drv_remove - free claimed resources
- * @pdev: platform device to work with
- */
-static int imx_pwm_drv_remove (struct platform_device *pdev)
+static int imx_pwm_drv_remove(struct platform_device *pdev)
{
struct resource *res;
- struct pwm_device *pwm=(struct pwm_device*)pdev->dev.driver_data;
+ struct pwm_device *pwm = (struct pwm_device*)pdev->dev.driver_data;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
unregister_sys_file(pwm);
- device_unregister(&pwm->class_dev);
+ device_destroy(pwm_class, MKDEV(gMajor, pdev->id));
free_irq(pwm->irq, pwm);
unregister_chrdev(gMajor, DRIVER_NAME);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1088,14 +1000,9 @@ static int imx_pwm_drv_remove (struct platform_device *pdev)
}
#ifdef CONFIG_PM
-/**
- * imx_pwm_drv_suspend - power down
- * @dev: platform device to work with
- * @state: state to reach
- */
-static int imx_pwm_drv_suspend (struct platform_device *pdev, pm_message_t state)
+static int imx_pwm_drv_suspend(struct platform_device *pdev, pm_message_t state)
{
- struct pwm_device *pwm=(struct pwm_device*)pdev->dev.driver_data;
+ struct pwm_device *pwm = (struct pwm_device*)pdev->dev.driver_data;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
clk_disable(pwm->clk);
@@ -1106,11 +1013,7 @@ static int imx_pwm_drv_suspend (struct platform_device *pdev, pm_message_t state
return 0;
}
-/**
- * imx_pwm_drv_resume - power up and continue
- * @pdev: platform device to work with
- */
-static int imx_pwm_drv_resume (struct platform_device *pdev)
+static int imx_pwm_drv_resume(struct platform_device *pdev)
{
struct pwm_device *pwm = (struct pwm_device*)pdev->dev.driver_data;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
@@ -1127,16 +1030,7 @@ static int imx_pwm_drv_resume (struct platform_device *pdev)
# define imx_pwm_drv_suspend NULL
# define imx_pwm_drv_resume NULL
-#endif // CONFIG_PM
-
-/**
- * pwm_class_release -
- * @dev:
- */
-static void pwm_class_release(struct device *dev)
-{
- return;
-}
+#endif /* CONFIG_PM */
static struct platform_driver imx_pwm_driver = {
.probe = imx_pwm_drv_probe,
@@ -1148,48 +1042,16 @@ static struct platform_driver imx_pwm_driver = {
},
};
-static struct sysdev_class pwm_sysclass = {
- .name = "pwm",
-};
-
-static struct sys_device pwm_sys_device = {
- .id = 0,
- .cls = &pwm_sysclass,
-};
-
-static struct class pwm_class = {
- .name = "pwm",
- .dev_release = pwm_class_release,
-};
-
-
static int __init imx_pwm_init(void)
{
- int ret;
-
- if (unlikely((ret = class_register(&pwm_class)))) {
- printk(KERN_ERR "%s: couldn't register class, exiting\n", DRIVER_NAME);
- return ret;
- }
-
- if (unlikely((ret = sysdev_class_register(&pwm_sysclass)))) {
- printk(KERN_ERR "%s: couldn't register sysdev class, exiting\n", DRIVER_NAME);
- goto out_sysdev_class;
- }
+ printk("i.MX PWM driver v" DRIVER_VERSION "\n");
- if (unlikely((ret = sysdev_register(&pwm_sys_device)))) {
- printk(KERN_ERR "%s: couldn't register sysdev, exiting\n", DRIVER_NAME);
- goto out_sysdev_register;
+ pwm_class = class_create(THIS_MODULE, "pwm");
+ if (IS_ERR(pwm_class)) {
+ return PTR_ERR(pwm_class);
}
return platform_driver_register(&imx_pwm_driver);
-
-out_sysdev_register:
- sysdev_class_unregister(&pwm_sysclass);
-out_sysdev_class:
- class_unregister(&pwm_class);
-
- return ret;
}
static void __exit imx_pwm_exit(void)
@@ -1197,11 +1059,10 @@ static void __exit imx_pwm_exit(void)
int i;
platform_driver_unregister(&imx_pwm_driver);
- sysdev_unregister(&pwm_sys_device);
- sysdev_class_unregister(&pwm_sysclass);
- class_unregister(&pwm_class);
+ class_destroy(pwm_class);
for (i=0; i<PWM_MAX_DEV; i++)
dev_table[i] = NULL;
+
printk(DRIVER_NAME " successfully unloaded\n");
}
diff --git a/target/linux/modules/pwm/pwm.h b/target/linux/modules/pwm/pwm.h
index 227e219..dbd3e6e 100644
--- a/target/linux/modules/pwm/pwm.h
+++ b/target/linux/modules/pwm/pwm.h
@@ -1,52 +1,52 @@
-/*
- * 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.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Copyright (C) 2002 Freescale Semiconductors HK Ltd
- *
- */
-
-#ifndef PWM_DEF_H
-#define PWM_DEF_H
-
-#include <linux/ioctl.h>
-
-#define PWM_SAMPLING_8KHZ 8000
-#define PWM_SAMPLING_16KHZ 16000
-#define PWM_SAMPLING_32KHZ 32000
-
-#define PWM_DATA_8BIT 8
-#define PWM_DATA_16BIT 16
-
-#define PWM_SWAP_HCTRL ((unsigned long)0x01<<18)
-#define PWM_SWAP_BCTRL ((unsigned long)0x01<<17)
-
-#define PWM_IOC_MAGIC 'p'
-#define PWM_IOC_SFREQ _IO(PWM_IOC_MAGIC, 0)
-#define PWM_IOC_SDATALEN _IO(PWM_IOC_MAGIC, 1)
-#define PWM_IOC_SMODE _IO(PWM_IOC_MAGIC, 2)
-#define PWM_IOC_SSAMPLE _IO(PWM_IOC_MAGIC, 3)
-#define PWM_IOC_SPERIOD _IO(PWM_IOC_MAGIC, 4)
-#define PWM_IOC_STOP _IO(PWM_IOC_MAGIC, 5)
-#define PWM_IOC_SWAPDATA _IO(PWM_IOC_MAGIC, 6)
-
-#define PWM_PLAY_MODE 1
-#define PWM_TONE_MODE 2
+/*
+ * 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.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Copyright (C) 2002 Freescale Semiconductors HK Ltd
+ *
+ */
+
+#ifndef _PWM_DEF_H_
+#define _PWM_DEF_H_
+
+#include <linux/ioctl.h>
+
+#define PWM_SAMPLING_8KHZ 8000
+#define PWM_SAMPLING_16KHZ 16000
+#define PWM_SAMPLING_32KHZ 32000
+
+#define PWM_DATA_8BIT 8
+#define PWM_DATA_16BIT 16
+
+#define PWM_SWAP_HCTRL ((unsigned long)0x01<<18)
+#define PWM_SWAP_BCTRL ((unsigned long)0x01<<17)
+
+#define PWM_IOC_MAGIC 'p'
+#define PWM_IOC_SFREQ _IO(PWM_IOC_MAGIC, 0)
+#define PWM_IOC_SDATALEN _IO(PWM_IOC_MAGIC, 1)
+#define PWM_IOC_SMODE _IO(PWM_IOC_MAGIC, 2)
+#define PWM_IOC_SSAMPLE _IO(PWM_IOC_MAGIC, 3)
+#define PWM_IOC_SPERIOD _IO(PWM_IOC_MAGIC, 4)
+#define PWM_IOC_STOP _IO(PWM_IOC_MAGIC, 5)
+#define PWM_IOC_SWAPDATA _IO(PWM_IOC_MAGIC, 6)
+
+#define PWM_PLAY_MODE 1
+#define PWM_TONE_MODE 2
struct imx_pwm_platform_data {
int (*init)(void);
int (*exit)(void);
};
-
-#endif
+
+#endif /* _PWM_DEF_H_*/
diff --git a/target/linux/modules/pwm/test/test_pwm.sh b/target/linux/modules/pwm/test/test_pwm.sh
new file mode 120000
index 0000000..2775d09
--- /dev/null
+++ b/target/linux/modules/pwm/test/test_pwm.sh
@@ -0,0 +1 @@
+../../../../test/test_pwm.sh
\ No newline at end of file
diff --git a/target/linux/modules/pwm/test/testpwm.sh b/target/linux/modules/pwm/test/testpwm.sh
deleted file mode 100755
index 93baf9f..0000000
--- a/target/linux/modules/pwm/test/testpwm.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# Script to test your PWM: plug either an oscilloscope or a buzzer on the signal
-# and launch this script
-#
-
-SYS_DIR="/sys/class/pwm/pwm0/"
-PERIOD="1000 2000 3000 4000 5000 6000 7000 8000 9000 10000"
-FREQUENCY="100 200 300 400 500 600"
-DUTY="001 250 333 500 666 750 999"
-
-if [ ! -d "$SYS_DIR" ]; then
- echo "Can't find /sys/ interface"
- exit 1
-fi
-
-echo "Starting PWM test"
-echo 1 > $SYS_DIR/active
-
-#Test frequency setting
-for freq in $FREQUENCY
-do
- echo $freq > $SYS_DIR/frequency
- echo "Setting PWM to $freq Hz"
- sleep 5
-done
-
-#Test period setting
-for period in $PERIOD
-do
- echo $period > $SYS_DIR/period
- echo "Setting PWM to $period us"
- sleep 5
-
-done
-
-#Test duty cycle setting @1kHz -> duty value = positive width signal value
-echo 1000 > $SYS_DIR/frequency
-for duty in $DUTY
-do
- echo $duty > $SYS_DIR/duty
- echo "Setting duty cycle to $duty/1000 "
- sleep 5
-done
-
-echo 0 > $SYS_DIR/active
-echo "End of PWM test"
diff --git a/target/test/test_pwm.sh b/target/test/test_pwm.sh
new file mode 100755
index 0000000..035e3e4
--- /dev/null
+++ b/target/test/test_pwm.sh
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2010 The 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 published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+#
+# Script to test your PWM: plug either an oscilloscope or a buzzer on the signal
+# and launch this script
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+SYS_DIR="/sys/class/pwm/pwm0/"
+PERIOD="1000 2000 3000 4000 5000 6000 7000 8000 9000 10000"
+FREQUENCY="100 200 300 400 500 600 700 800"
+DUTY="001 250 333 500 666 750 999"
+SLEEP_TIME=4
+
+
+prepare_test_for_apf9328()
+{
+ ask_user "Please connect your oscilloscope probe to pin 4 of X21 connector (press ENTER when ready)"
+}
+
+prepare_test_for_apf27()
+{
+ ask_user "Please connect your oscilloscope probe to pin 4 of J22 connector (press ENTER when ready)"
+}
+
+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 prepare_test_for_apf9328 prepare_test_for_apf27
+
+ ask_user "Press ENTER when ready to check PWM output (frequencies starting at 100Hz)"
+ echo 1 > $SYS_DIR/active
+ # Test frequency setting
+ for freq in $FREQUENCY; do
+ echo $freq > $SYS_DIR/frequency
+ echo "Setting PWM frequency to $freq Hz"
+ sleep $SLEEP_TIME
+ done
+
+ ask_user "Press ENTER when ready to check PWM output (periods)"
+ # Test period setting
+ for period in $PERIOD; do
+ echo $period > $SYS_DIR/period
+ freq=$((1000000/period))
+ echo "Setting PWM period to $period us (-> $freq Hz)"
+ sleep $SLEEP_TIME
+ done
+
+ ask_user "Press ENTER when ready to check PWM output (duty cycle @ 100Hz)"
+ # Test duty cycle setting @ 100Hz -> duty value = positive width signal value
+ echo 100 > $SYS_DIR/frequency
+ for duty in $DUTY; do
+ echo $duty > $SYS_DIR/duty
+ echo "Setting duty cycle to $duty/1000 "
+ sleep $SLEEP_TIME
+ done
+
+ echo 500 > $SYS_DIR/duty
+ echo 0 > $SYS_DIR/active
+ echo "End of PWM test"
+
+ ask_user "Did you get correct signals ? (y/N)"
+ if [ "$response" != "y" ] && [ "$response" != "yes" ]; then
+ exit_failed
+ fi
+
+ echo_test_ok
+ exit 0
+}
+
+test_pwm
+
diff --git a/target/test/test_release.sh b/target/test/test_release.sh
index 9bece6e..5a2d2b4 100755
--- a/target/test/test_release.sh
+++ b/target/test/test_release.sh
@@ -62,6 +62,8 @@ $THIS_DIR/test_fpga.sh
echo
$THIS_DIR/test_gpio.sh
echo
+$THIS_DIR/test_pwm.sh
+echo
$THIS_DIR/media_perf.sh speed
# Following tests needs Internet access:
ask_user "I will now try to configure Internet access. Press ENTER when ready"
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-16 21:49:22
|
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 927b7a7bb2772e43c3c6d50d769ed9e8e09e3424 (commit)
via 578d824b8987307b5f4518381f9771cb87953fee (commit)
from 3548856d4e58383048ab017dbd71079720e3867f (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 927b7a7bb2772e43c3c6d50d769ed9e8e09e3424
Author: Julien Boibessot <jul...@ar...>
Date: Tue Mar 16 22:47:39 2010 +0100
Indentation
commit 578d824b8987307b5f4518381f9771cb87953fee
Author: Julien Boibessot <jul...@ar...>
Date: Tue Mar 16 10:15:55 2010 +0100
[LINUX] Add 24MHz external clock support to TSC210x
-----------------------------------------------------------------------
Summary of changes:
.../2.6.29/073-armadeus-tsc2102.patch | 16 +-
target/linux/modules/pwm/pwm.c | 335 ++++++++++----------
2 files changed, 183 insertions(+), 168 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
index d6d83b7..b70bfa7 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/073-armadeus-tsc2102.patch
@@ -4,7 +4,7 @@ DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/include/linux/spi/tsc2102.h 2010-01-19 10:25:41.000000000 +0100
++++ linux-2.6.29.6/include/linux/spi/tsc2102.h 2010-02-24 15:11:28.000000000 +0100
@@ -0,0 +1,302 @@
+/*
+ * include/linux/spi/tsc2102.h
@@ -311,8 +311,8 @@ Index: linux-2.6.29.6/include/linux/spi/tsc2102.h
Index: linux-2.6.29.6/drivers/spi/tsc2102.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/drivers/spi/tsc2102.c 2010-01-19 11:19:57.000000000 +0100
-@@ -0,0 +1,1188 @@
++++ linux-2.6.29.6/drivers/spi/tsc2102.c 2010-03-15 12:06:23.000000000 +0100
+@@ -0,0 +1,1198 @@
+/*
+ * drivers/spi/tsc2102.c
+ *
@@ -884,6 +884,11 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ pll->pll2 = (PLL2_D_VAL(6448));
+ break;
+
++ case 24000000:
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(2) | PLL1_J_VAL(7));
++ pll->pll2 = (PLL2_D_VAL(5264));
++ break;
++
+ default:
+ pll->pll1 = 0x811c;
+ pll->pll2 = (PLL2_D_VAL(5462));
@@ -903,6 +908,11 @@ Index: linux-2.6.29.6/drivers/spi/tsc2102.c
+ pll->pll2 = (PLL2_D_VAL(1440));
+ break;
+
++ case 24000000:
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(2) | PLL1_J_VAL(8));
++ pll->pll2 = (PLL2_D_VAL(1920));
++ break;
++
+ default:
+ pll->pll1 = 0x8120;
+ pll->pll2 = (PLL2_D_VAL(1920));
diff --git a/target/linux/modules/pwm/pwm.c b/target/linux/modules/pwm/pwm.c
index 9de2847..2fca2ad 100644
--- a/target/linux/modules/pwm/pwm.c
+++ b/target/linux/modules/pwm/pwm.c
@@ -46,13 +46,12 @@
#include <linux/wait.h>
#include <linux/pm.h>
#include <linux/clk.h>
-/* For /sys */
#include <linux/sysdev.h>
/* For struct class */
#include <linux/device.h>
-/* For circular buffer */
#include <linux/circ_buf.h>
#include <linux/platform_device.h>
+
#include "pwm.h"
#ifdef CONFIG_ARCH_MX2
@@ -62,57 +61,57 @@
#define PWMSAMPLE (0x0c)
#define PWMPERIOD (0x10)
#define PWMCOUNTER (0x14)
-#define PWM_EN (1<<0)
-#define PWM_IRQEN (1<<0)
-#define PWM_SWR (1<<3)
-#define PWM_CLKSRC_MASK (3<<16)
-#define PWM_CLKSRC_IPG (2<<16)
-#define PWM_CLKSRC_32K (3<<16)
-#define PWM_REPEAT_MASK (3<<1)
-#define PWM_HCTR (1<<20)
-#define PWM_BCTR (1<<21)
-#define PWM_FWM_3 (2<<26)
-#define PWM_FIFOAV (7<<0)
-#define PWM_FIFO_EMPTY (1<<3)
-#define PWM_FWM (3<<26)
-#define PWM_REPEAT(x) (((x) & 0x03) << 1)
-#define PWM_CLKSEL_MASK (0)
+#define PWM_EN (1<<0)
+#define PWM_IRQEN (1<<0)
+#define PWM_SWR (1<<3)
+#define PWM_CLKSRC_MASK (3<<16)
+#define PWM_CLKSRC_IPG (2<<16)
+#define PWM_CLKSRC_32K (3<<16)
+#define PWM_REPEAT_MASK (3<<1)
+#define PWM_HCTR (1<<20)
+#define PWM_BCTR (1<<21)
+#define PWM_FWM_3 (2<<26)
+#define PWM_FIFOAV (7<<0)
+#define PWM_FIFO_EMPTY (1<<3)
+#define PWM_FWM (3<<26)
+#define PWM_REPEAT(x) (((x) & 0x03) << 1)
+#define PWM_CLKSEL_MASK (0)
#define PWM_PRESCALER_MASK 0x0000FFF0
#define PWM_PRESCALER(x) (((x-1) & 0xFFF) << 4)
#define PWM_PERIOD(x) ((x) & 0xFFFF)
-#define PWM_SAMPLE(x) ((x) & 0xFFFF)
-#define PWM_INT MXC_INT_PWM
-#define PWM_MAX_DEV 1
+#define PWM_SAMPLE(x) ((x) & 0xFFFF)
+#define PWM_INT MXC_INT_PWM
+#define PWM_MAX_DEV 1
-#define PWM_MIN_FREQUENCY 1 // Hz
-#define PWM_MAX_FREQUENCY 1000000 /* Hz */
+#define PWM_MIN_FREQUENCY 1 /* Hz */
+#define PWM_MAX_FREQUENCY 1000000 /* Hz */
#else
-#define PWMCTRL (0x00)
-#define PWMSTATUS (0x00)
-#define PWMIRQ (0x00)
-#define PWMSAMPLE (0x04)
-#define PWMPERIOD (0x08)
-#define PWMCOUNTER (0x0C)
-#define PWM_EN (1<<4)
-#define PWM_IRQEN PWMC_IRQEN
-#define PWM_SWR PWMC_SWR
-#define PWM_CLKSRC_MASK (1<<15)
-#define PWM_CLKSRC_IPG (0<<15)
-#define PWM_CLKSRC_32K (1<<15)
-#define PWM_FWM_3 (2<<26)
-#define PWM_FWM (3<<26)
-#define PWM_HCTR PWMC_HCTR
-#define PWM_BCTR PWMC_BCTR
-#define PWM_FIFOAV PWMC_FIFOAV
-#define PWM_REPEAT_MASK 0x0000000C
-#define PWM_CLKSEL_MASK 0x00000003
-#define PWM_REPEAT(x) PWMC_REPEAT(x)
+#define PWMCTRL (0x00)
+#define PWMSTATUS (0x00)
+#define PWMIRQ (0x00)
+#define PWMSAMPLE (0x04)
+#define PWMPERIOD (0x08)
+#define PWMCOUNTER (0x0C)
+#define PWM_EN (1<<4)
+#define PWM_IRQEN PWMC_IRQEN
+#define PWM_SWR PWMC_SWR
+#define PWM_CLKSRC_MASK (1<<15)
+#define PWM_CLKSRC_IPG (0<<15)
+#define PWM_CLKSRC_32K (1<<15)
+#define PWM_FWM_3 (2<<26)
+#define PWM_FWM (3<<26)
+#define PWM_HCTR PWMC_HCTR
+#define PWM_BCTR PWMC_BCTR
+#define PWM_FIFOAV PWMC_FIFOAV
+#define PWM_REPEAT_MASK 0x0000000C
+#define PWM_CLKSEL_MASK 0x00000003
+#define PWM_REPEAT(x) PWMC_REPEAT(x)
#define PWM_PRESCALER_MASK 0x00007F00
#define PWM_PRESCALER(x) PWMC_PRESCALER(x)
-#define PWM_PERIOD(x) PWMP_PERIOD(x)
-#define PWM_SAMPLE(x) PWMS_SAMPLE(x)
-#define PWM_MAX_DEV 1
+#define PWM_PERIOD(x) PWMP_PERIOD(x)
+#define PWM_SAMPLE(x) PWMS_SAMPLE(x)
+#define PWM_MAX_DEV 1
#define PWM_MIN_FREQUENCY 2 /* Hz */
#define PWM_MAX_FREQUENCY 1000000 /* Hz */
@@ -187,27 +186,29 @@ static struct class pwm_class; /* forward declaration only */
* Circular buffer handling four sound playing
***************************************************************/
-static inline u8 get_byte_from_circbuf( struct sound_circ_buf* abuffer )
+static inline u8 get_byte_from_circbuf(struct sound_circ_buf* abuffer)
{
- u8 b = abuffer->buf[ abuffer->read ];
+ u8 b = abuffer->buf[abuffer->read];
abuffer->read = (abuffer->read + 1) & (abuffer->size - 1);
+
return b;
}
-static inline u16 get_word_from_circbuf( struct sound_circ_buf* abuffer )
+static inline u16 get_word_from_circbuf(struct sound_circ_buf* abuffer)
{
u16 w = *((u16*)(&(abuffer->buf[ abuffer->read ])));
abuffer->read = (abuffer->read + 2) & (abuffer->size - 1);
+
return w;
}
-static inline void put_byte_to_circbuf( struct sound_circ_buf* abuffer, unsigned char abyte )
+static inline void put_byte_to_circbuf(struct sound_circ_buf* abuffer, unsigned char abyte)
{
- abuffer->buf[ abuffer->write ] = abyte;
+ abuffer->buf[abuffer->write] = abyte;
abuffer->write = (abuffer->write + 1) & (abuffer->size - 1);
}
-static inline void increase_circbuf( struct sound_circ_buf* abuffer, int count )
+static inline void increase_circbuf(struct sound_circ_buf* abuffer, int count)
{
abuffer->write = (abuffer->write + count) & (abuffer->size - 1);
pr_debug("Added %d bytes to buffer, now write is in pos %d\n", count, abuffer->write);
@@ -215,7 +216,7 @@ static inline void increase_circbuf( struct sound_circ_buf* abuffer, int count )
static int get_current_pwm_clk_rate(struct pwm_device *pwm)
{
- if( (readl(pwm->membase + PWMCTRL) & PWM_CLKSRC_MASK) == PWM_CLKSRC_32K)
+ if ((readl(pwm->membase + PWMCTRL) & PWM_CLKSRC_MASK) == PWM_CLKSRC_32K)
return 32768;
#ifdef CONFIG_ARCH_MX2
return clk_get_rate(pwm->clk);
@@ -240,21 +241,20 @@ static long get_pwm_max_freq(struct pwm_device *pwm)
static void compute_pwm_params(u32 req_freq, struct pwm_device *pwm)
{
u32 input_freq, divider;
+
input_freq = get_current_pwm_clk_rate(pwm);
// printk("input freq, %x %x\n", input_freq, req_freq);
divider = ((input_freq*10)/req_freq+5)/10;
- if( divider/65536 ){
+ if (divider/65536) {
pwm->entry.prescaler = divider/65536 +1;
pwm->entry.period = input_freq/(pwm->entry.prescaler*req_freq)-2;
- }
- else{
+ } else {
pwm->entry.period = divider-2;
pwm->entry.prescaler = 1;
}
}
-
/****************************************************************
*
***************************************************************/
@@ -271,15 +271,15 @@ static void write_bits(u32 bit, u32 mask, unsigned long reg)
static void setup_pwm_params(struct pwm_device *pwm)
{
- write_bits( PWM_CLKSRC_IPG, PWM_CLKSRC_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_CLKSRC_IPG, PWM_CLKSRC_MASK, pwm->membase + PWMCTRL);
/* Setup prescaler */
pr_debug("Updating PWM registers\n");
- write_bits( PWM_PRESCALER(pwm->entry.prescaler),
- PWM_PRESCALER_MASK, pwm->membase + PWMCTRL ); /*| PWMC_REPEAT(3)*/;
+ write_bits(PWM_PRESCALER(pwm->entry.prescaler),
+ PWM_PRESCALER_MASK, pwm->membase + PWMCTRL); /*| PWMC_REPEAT(3)*/;
/* Setup period */
- writel(PWM_PERIOD(pwm->entry.period) , pwm->membase + PWMPERIOD );
+ writel(PWM_PERIOD(pwm->entry.period), pwm->membase + PWMPERIOD);
/* Setup duty cycle */
- writel(PWM_SAMPLE( (u32) ((pwm->entry.period * pwm->duty) / 1000) ),
+ writel(PWM_SAMPLE((u32)((pwm->entry.period * pwm->duty) / 1000)),
pwm->membase + PWMSAMPLE);
}
@@ -292,11 +292,11 @@ static void setup_pwm_unit(struct pwm_device *pwm)
{
if (pwm->active) {
/* Activate PWM */
- write_bits( PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
setup_pwm_params(pwm);
} else {
/* De-activate */
- write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(~PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
}
}
@@ -306,7 +306,7 @@ static int create_timer(pwm_timer_t *timer)
init_timer(timer->timer_blk_ptr);
timer->timer_blk_ptr->function = timer->timer_func;
- return(0);
+ return 0;
}
static int start_timer(pwm_timer_t *timer)
@@ -316,7 +316,7 @@ static int start_timer(pwm_timer_t *timer)
add_timer((struct timer_list *)timer->timer_blk_ptr);
- return(0);
+ return 0;
}
static int stop_timer(pwm_timer_t *timer)
@@ -324,16 +324,16 @@ static int stop_timer(pwm_timer_t *timer)
timer->stop_flag = 1;
del_timer_sync((struct timer_list *)timer->timer_blk_ptr);
- return(0);
+ return 0;
}
static void stop_pwm(struct pwm_device *pwm)
{
- write_bits( ~PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ );
- write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(~PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
+ write_bits(~PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
pwm->sampleValue = 0;
- if(pwm->mode == PWM_TONE_MODE)
+ if (pwm->mode == PWM_TONE_MODE)
stop_timer(&pwm->timer);
/* Can release file now */
@@ -347,7 +347,7 @@ static void pwmIntFunc( unsigned long unused)
{
// u32 period;
- PK("<1>pwm sam int\n");
+ PK("<1>pwm sam int\n");
// if (gWriteCnt > 0)
// {
@@ -374,11 +374,11 @@ static void pwmIntFunc( unsigned long unused)
static int init_pwm(struct pwm_device *pwm)
{
/* Software reset */
- write_bits( PWM_SWR, PWM_SWR, pwm->membase + PWMCTRL );
+ write_bits(PWM_SWR, PWM_SWR, pwm->membase + PWMCTRL);
udelay(10);
/* Activate & de-activate PWM (seems to be necessary after a reset) */
- write_bits( PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
- write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
+ write_bits(~PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
return 1;
}
@@ -393,15 +393,16 @@ int pwm_release(struct inode * inode, struct file * filp)
interruptible_sleep_on(&pwm->exit_wait);
if (pwm->mode == PWM_PLAY_MODE) {
/* disable IRQ */
- write_bits( ~PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
+ write_bits(~PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
}
- write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(~PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
- if( pwm->circ_buf.buf ) {
- kfree( pwm->circ_buf.buf );
+ if (pwm->circ_buf.buf) {
+ kfree(pwm->circ_buf.buf);
pwm->circ_buf.buf = 0;
}
printk(DRIVER_NAME " released, 4 bytes FIFO usage: %d\n", pwm->nbbytes);
+
return 0;
}
@@ -416,6 +417,7 @@ int pwm_open(struct inode * inode, struct file * filp)
init_pwm(pwm);
pr_debug(DRIVER_NAME " opened \n");
+
return 0;
}
@@ -467,36 +469,36 @@ int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigne
{
/*int clock = get_current_pwm_clk_rate(pwm);*/
/* Disable PWM */
- write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(~PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
/* if(!( (clock >= 16000000) && (clock<17000000))){
printk("audio playback works only with a 16MHz input clock %d!\n",
get_current_pwm_clk_rate(pwm));
break;
}*/
- write_bits( PWM_CLKSRC_IPG, PWM_CLKSRC_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_CLKSRC_IPG, PWM_CLKSRC_MASK, pwm->membase + PWMCTRL);
#ifdef CONFIG_ARCH_MX2
- write_bits( PWM_PRESCALER(2),PWM_PRESCALER_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_PRESCALER(2), PWM_PRESCALER_MASK, pwm->membase + PWMCTRL);
#else
- write_bits( PWM_PRESCALER(1),PWM_PRESCALER_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_PRESCALER(1), PWM_PRESCALER_MASK, pwm->membase + PWMCTRL);
#endif
- switch(arg)
- {
+ switch (arg) {
case PWM_SAMPLING_32KHZ:
/* REPEAT = 0 => divide by 1 */
- write_bits( 0, PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
+ write_bits(0, PWM_REPEAT_MASK, pwm->membase + PWMCTRL);
str = "32Khz";
break;
+
case PWM_SAMPLING_16KHZ:
/* REPEAT = 01 => divide by 2 */
- write_bits( PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL);
str = "16Khz";
break;
case PWM_SAMPLING_8KHZ:
default:
/* REPEAT = 10 => divide by 4*/
- write_bits( PWM_REPEAT(2), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
+ write_bits(PWM_REPEAT(2), PWM_REPEAT_MASK, pwm->membase + PWMCTRL);
str = "8Khz";
break;
}
@@ -525,8 +527,7 @@ int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigne
break;
case PWM_IOC_SPERIOD:
- if (pwm->mode == PWM_TONE_MODE)
- {
+ if (pwm->mode == PWM_TONE_MODE) {
PK("<1>PWM period = %d\n",(int)arg);
pwm->timer.period = arg/12;
}
@@ -537,22 +538,22 @@ int pwm_ioctl(struct inode * inode, struct file *filp, unsigned int cmd, unsigne
break;
case PWM_IOC_SWAPDATA:
- if (arg&PWM_SWAP_HCTRL) { /* Halfword FIFO data swapping */
- write_bits( PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
- write_bits( PWM_HCTR, PWM_HCTR, pwm->membase + PWMCTRL );
+ if (arg & PWM_SWAP_HCTRL) { /* Halfword FIFO data swapping */
+ write_bits(PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL);
+ write_bits(PWM_HCTR, PWM_HCTR, pwm->membase + PWMCTRL);
} else {
- write_bits( ~PWM_HCTR, PWM_HCTR, pwm->membase + PWMCTRL );
+ write_bits(~PWM_HCTR, PWM_HCTR, pwm->membase + PWMCTRL);
}
if (arg & PWM_SWAP_BCTRL) { /* Byte FIFO data swapping */
- write_bits( PWM_BCTR, PWM_BCTR, pwm->membase + PWMCTRL );
+ write_bits(PWM_BCTR, PWM_BCTR, pwm->membase + PWMCTRL);
} else {
- write_bits( ~PWM_BCTR, PWM_BCTR, pwm->membase + PWMCTRL );
+ write_bits(~PWM_BCTR, PWM_BCTR, pwm->membase + PWMCTRL);
}
break;
default:
- printk( DRIVER_NAME ": unkown IOCTL\n");
+ printk(DRIVER_NAME ": unkown IOCTL\n");
break;
}
@@ -581,13 +582,13 @@ static ssize_t pwm_write( struct file *filp, const char *buf, size_t count, loff
struct pwm_device *pwm = dev_table[iminor(filp->f_dentry->d_inode)];
struct sound_circ_buf *circ = &pwm->circ_buf;
- pr_debug( "pwm_write ----\n" );
+ pr_debug("pwm_write ----\n");
if (count > MAX_SOUND_BUFFER_SIZE)
count = MAX_SOUND_BUFFER_SIZE;
/* First time, allocate the double buffer */
if (!circ->buf) {
- circ->buf = kmalloc( MAX_SOUND_BUFFER_SIZE*2, GFP_KERNEL );
+ circ->buf = kmalloc(MAX_SOUND_BUFFER_SIZE*2, GFP_KERNEL);
if (!circ->buf) {
goto out;
} else {
@@ -604,17 +605,18 @@ static ssize_t pwm_write( struct file *filp, const char *buf, size_t count, loff
pr_debug("Remaining space to end: %d, must write: %d \n", remaining_space, count);
if (remaining_space >= count) {
// Get data from UserSpace
- if( copy_from_user( circ->buf + circ->write , buf, count ) ) {
- ret = -EFAULT; goto out;
+ if (copy_from_user(circ->buf + circ->write, buf, count)) {
+ ret = -EFAULT;
+ goto out;
}
- increase_circbuf( &pwm->circ_buf, count );
+ increase_circbuf(&pwm->circ_buf, count);
/* if not enough space, then */
} else {
/* Do it in 2 times */
if (copy_from_user(circ->buf + circ->write, buf, remaining_space)) {
ret = -EFAULT; goto out;
}
- increase_circbuf( &pwm->circ_buf, remaining_space );
+ increase_circbuf(&pwm->circ_buf, remaining_space);
if (copy_from_user(circ->buf + circ->write, buf, count - remaining_space)) {
ret = -EFAULT; goto out;
}
@@ -623,19 +625,19 @@ static ssize_t pwm_write( struct file *filp, const char *buf, size_t count, loff
if (pwm->mode == PWM_PLAY_MODE) {
/* Enable IRQ */
- write_bits( PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
+ write_bits(PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
} else {
- writel(pwm->sampleValue, pwm->membase + PWMSAMPLE);
+ writel(pwm->sampleValue, pwm->membase + PWMSAMPLE);
/* set prescaler to the max */
- write_bits(PWM_PRESCALER(0xffff) , PWM_PRESCALER_MASK, pwm->membase + PWMCTRL);
+ write_bits(PWM_PRESCALER(0xffff), PWM_PRESCALER_MASK, pwm->membase + PWMCTRL);
/*writeBufPtr16 = (u16*)gpWriteBuf;
gWriteCnt /= 2; //input size is 8bit size, need /2 to get 16bit size
StartTimer( &timer );*/
}
- writel(0x00000000, pwm->membase + PWMSAMPLE);
- write_bits( PWM_FWM_3 , PWM_FWM, pwm->membase + PWMCTRL );
+ writel(0x00000000, pwm->membase + PWMSAMPLE);
+ write_bits(PWM_FWM_3, PWM_FWM, pwm->membase + PWMCTRL);
/* Enable PWM */
- write_bits( PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
+ write_bits(PWM_EN, PWM_EN, pwm->membase + PWMCTRL);
/* Calculate how much space is left in buffer */
remaining_space = CIRC_SPACE(circ->write, circ->read, circ->size);
@@ -646,7 +648,7 @@ static ssize_t pwm_write( struct file *filp, const char *buf, size_t count, loff
}
out:
- pr_debug( "out pwm_write PWMC = 0x%8x ----\n", readl(pwm->membase + PWMCTRL ));
+ pr_debug("out pwm_write PWMC = 0x%8x ----\n", readl(pwm->membase + PWMCTRL));
return count;
}
@@ -672,7 +674,7 @@ static ssize_t pwm_show_duty(struct device *dev, struct device_attribute *attr,
ssize_t ret_size = 0;
struct pwm_device *pwm = to_pwm_device(dev);
- ret_size=sprintf(buf,"%u",pwm->duty);
+ ret_size=sprintf(buf, "%u", pwm->duty);
return ret_size;
}
@@ -699,7 +701,7 @@ static ssize_t pwm_store_duty(struct device *dev, struct device_attribute *attr,
if ((value < 1) || (value > 999))
return -EIO;
- pwm->duty=(unsigned)value;
+ pwm->duty = (unsigned)value;
setup_pwm_unit(pwm);
return size;
@@ -715,7 +717,7 @@ static ssize_t pwm_show_period(struct device *dev, struct device_attribute *attr
ssize_t ret_size = 0;
struct pwm_device *pwm = to_pwm_device(dev);
- ret_size=sprintf(buf,"%d",pwm->entry.period);
+ ret_size = sprintf(buf, "%d", pwm->entry.period);
return ret_size;
}
@@ -734,12 +736,13 @@ static ssize_t pwm_store_period(struct device *dev, struct device_attribute *att
long value/*,i*/;
struct pwm_device *pwm = to_pwm_device(dev);
- value = simple_strtol(buf, NULL, 10); // in us
+ value = simple_strtol(buf, NULL, 10); /* in us */
if ((value < (1000000/get_pwm_max_freq(pwm))) || (value > (1000000/get_pwm_min_freq(pwm))))
return -EIO;
compute_pwm_params(1000000/value, pwm);
setup_pwm_unit(pwm);
+
return size;
}
@@ -754,9 +757,9 @@ static ssize_t pwm_show_frequency(struct device *dev, struct device_attribute *a
struct pwm_device *pwm = to_pwm_device(dev);
if (pwm->entry.period)
- ret_size = sprintf(buf,"%d", (u32) 1000000/(pwm->entry.period));
+ ret_size = sprintf(buf, "%d", (u32) 1000000/(pwm->entry.period));
else
- ret_size = sprintf(buf,"0");
+ ret_size = sprintf(buf, "0");
return ret_size;
}
@@ -779,13 +782,13 @@ static ssize_t pwm_store_frequency(struct device *dev, struct device_attribute *
struct pwm_device *pwm = to_pwm_device(dev);
value = simple_strtol(buf, NULL, 10);
- if( (value < get_pwm_min_freq(pwm)) || (value > get_pwm_max_freq(pwm)) )
+ if ((value < get_pwm_min_freq(pwm)) || (value > get_pwm_max_freq(pwm)))
return -EIO;
compute_pwm_params(value, pwm);
setup_pwm_unit(pwm);
- return( size );
+ return size;
}
/**
@@ -798,7 +801,7 @@ static ssize_t pwm_show_state(struct device *dev, struct device_attribute *attr,
ssize_t ret_size = 0;
struct pwm_device *pwm = to_pwm_device(dev);
- ret_size=sprintf(buf,"%d",pwm->active);
+ ret_size = sprintf(buf, "%d", pwm->active);
return ret_size;
}
@@ -818,9 +821,9 @@ static ssize_t pwm_store_state(struct device *dev, struct device_attribute *attr
value = simple_strtol(buf, NULL, 10);
if (value != 0)
- pwm->active=1;
+ pwm->active = 1;
else
- pwm->active=0;
+ pwm->active = 0;
setup_pwm_unit(pwm);
@@ -868,23 +871,23 @@ static irqreturn_t pwm_interrupt(int irq, void *dev_id)
#else
status = readl(pwm->membase + PWMSTATUS);
#endif
- remaining = CIRC_CNT( pwm->circ_buf.write, pwm->circ_buf.read, pwm->circ_buf.size );
- if( remaining <= 1024 && remaining > 1021 ) { // TODO make it better (I think a test each consumed sample is the only accurate solution
- // Can accept new data now
- wake_up_interruptible( &pwm->write_wait );
+ remaining = CIRC_CNT(pwm->circ_buf.write, pwm->circ_buf.read, pwm->circ_buf.size);
+ if (remaining <= 1024 && remaining > 1021) { /* TODO make it better (I think a test each consumed sample is the only accurate solution */
+ /* Can accept new data now */
+ wake_up_interruptible(&pwm->write_wait);
}
/* End of sound buffer */
- if( remaining < 3 ) {
- if(pwm->dataLen == PWM_DATA_8BIT) {
- while( remaining ) {
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ if (remaining < 3) {
+ if (pwm->dataLen == PWM_DATA_8BIT) {
+ while (remaining) {
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
/*PK("<1>(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS);*/
remaining--;
}
} else { /* PWM_DATA_16BIT) */
- while( remaining ) {
- writel( (u32)(get_word_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ while (remaining) {
+ writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
//PK("<1>(%d) pwm_int: PWMS = 0x%8x\n", gWriteCnt, PWMS);
remaining--;
}
@@ -895,31 +898,31 @@ static irqreturn_t pwm_interrupt(int irq, void *dev_id)
/* Put sound samples in FIFO */
if (pwm->dataLen == PWM_DATA_8BIT) {
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
#ifdef CONFIG_ARCH_MX2
if ((readl(pwm->membase + PWMSTATUS) & PWM_FIFOAV) == 3) { /* TODO: verify if needed */
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
}
#else
if ((readl(pwm->membase + PWMSTATUS) & PWM_FIFOAV) > 0) { /* TODO: verify if needed */
- writel( (u32)(get_byte_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_byte_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
}
#endif
} else { /* PWM_DATA_16BIT) */
// TODO: put good value in PWMC_BCTR to auto swap bytes if needed (do it at write or ioctl)
- writel( (u32)(get_word_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
- writel( (u32)(get_word_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
- writel( (u32)(get_word_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
if ((readl(pwm->membase + PWMSTATUS) & PWM_FIFOAV) > 0) { /* TODO: verify if needed */
- writel( (u32)(get_word_from_circbuf( &pwm->circ_buf )), pwm->membase + PWMSAMPLE);
+ writel((u32)(get_word_from_circbuf(&pwm->circ_buf)), pwm->membase + PWMSAMPLE);
pwm->nbbytes++;
}
}
end:
- return(IRQ_HANDLED);
+ return IRQ_HANDLED;
}
/**
@@ -933,12 +936,12 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
struct pwm_device *pwm;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
- printk(KERN_INFO " Initializing PWM#%u...",pdev->id);
+ printk(KERN_INFO "Initializing PWM%u...", pdev->id);
- if( pdev->id >= PWM_MAX_DEV )
+ if (pdev->id >= PWM_MAX_DEV)
printk(DRIVER_NAME " failed. Unknown PWM%u device. Remember that this device only supports %d PWM\n", pdev->id, PWM_MAX_DEV);
- if ( dev_table[pdev->id] != NULL ) {
+ if (dev_table[pdev->id] != NULL) {
printk(KERN_ERR ": already used\n");
return -ENODEV;
}
@@ -955,9 +958,9 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
pwm->class_dev.class = &pwm_class;
pwm->class_dev.parent = &pdev->dev;
snprintf(pwm->class_dev.bus_id, BUS_ID_SIZE, "pwm%i", pdev->id);
- pwm->active=0;
- pwm->duty=500; /* = 50.O% */
- pdev->dev.driver_data=pwm;
+ pwm->active = 0;
+ pwm->duty = 500; /* = 50.O% */
+ pdev->dev.driver_data = pwm;
dev_table[pdev->id] = pwm;
pwm->irq = platform_get_irq(pdev, 0);
@@ -967,13 +970,13 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
goto error_malloc;
}
- if (unlikely(!(res = platform_get_resource(pdev, IORESOURCE_MEM, 0)))){
+ if (unlikely(!(res = platform_get_resource(pdev, IORESOURCE_MEM, 0)))) {
printk(KERN_ERR "Unable to get mem ressource\n");
err = -ENOENT;
goto error_malloc;
}
- if (unlikely(!request_mem_region( res->start, res->end - res->start + 1, DRIVER_NAME ))) {
+ if (unlikely(!request_mem_region(res->start, res->end - res->start + 1, DRIVER_NAME))) {
printk(KERN_ERR "Region busy\n");
err = -EBUSY;
goto error_malloc;
@@ -990,7 +993,7 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
/* Dynamic Major allocation */
if (gMajor == 0) {
gMajor = err;
- printk("PWM major number = %d\n",gMajor);
+ printk("PWM major number = %d\n", gMajor);
}
err = request_irq(pwm->irq, pwm_interrupt, IRQF_DISABLED, DRIVER_NAME, pwm);
@@ -1033,13 +1036,13 @@ static int imx_pwm_drv_probe(struct platform_device *pdev)
init_pwm(pwm);
printk("i.MX PWM driver v" DRIVER_VERSION "\n");
- return(0);
+ return 0;
error_file:
printk(KERN_ERR "%s: class /sys file creation failed\n", DRIVER_NAME);
unregister_sys_file(pwm);
error_register:
- device_unregister( &pwm->class_dev );
+ device_unregister(&pwm->class_dev);
error_irq:
free_irq(pwm->irq, pwm);
error_chrdev:
@@ -1051,13 +1054,13 @@ error_malloc:
return err;
}
-static inline void unregister_sys_file( struct pwm_device *pwm )
+static inline void unregister_sys_file(struct pwm_device *pwm)
{
/* Unregister /sys attributes */
- device_remove_file( &pwm->class_dev, &dev_attr_active );
- device_remove_file( &pwm->class_dev, &dev_attr_period );
- device_remove_file( &pwm->class_dev, &dev_attr_frequency );
- device_remove_file( &pwm->class_dev, &dev_attr_duty );
+ device_remove_file(&pwm->class_dev, &dev_attr_active);
+ device_remove_file(&pwm->class_dev, &dev_attr_period);
+ device_remove_file(&pwm->class_dev, &dev_attr_frequency);
+ device_remove_file(&pwm->class_dev, &dev_attr_duty);
}
/**
@@ -1071,15 +1074,16 @@ static int imx_pwm_drv_remove (struct platform_device *pdev)
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
unregister_sys_file(pwm);
- device_unregister( &pwm->class_dev );
+ device_unregister(&pwm->class_dev);
free_irq(pwm->irq, pwm);
unregister_chrdev(gMajor, DRIVER_NAME);
- res = platform_get_resource( pdev, IORESOURCE_MEM, 0 );
- release_mem_region( res->start, res->end - res->start + 1 );
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ release_mem_region(res->start, res->end - res->start + 1);
kfree(pwm);
dev_table[pdev->id] = NULL;
- if( pdata->exit() )
+ if (pdata->exit())
pdata->exit();
+
return 0;
}
@@ -1096,7 +1100,7 @@ static int imx_pwm_drv_suspend (struct platform_device *pdev, pm_message_t state
clk_disable(pwm->clk);
dev_dbg(&pdev->dev, "suspended\n");
- if( pdata->exit() )
+ if (pdata->exit())
pdata->exit();
return 0;
@@ -1108,13 +1112,14 @@ static int imx_pwm_drv_suspend (struct platform_device *pdev, pm_message_t state
*/
static int imx_pwm_drv_resume (struct platform_device *pdev)
{
- struct pwm_device *pwm=(struct pwm_device*)pdev->dev.driver_data;
+ struct pwm_device *pwm = (struct pwm_device*)pdev->dev.driver_data;
struct imx_pwm_platform_data *pdata = pdev->dev.platform_data;
clk_enable(pwm->clk);
dev_dbg(&pdev->dev, "resumed\n");
- if( pdata->init() )
+ if (pdata->init())
pdata->init();
+
return 0;
}
#else
@@ -1162,8 +1167,6 @@ static int __init imx_pwm_init(void)
{
int ret;
- printk(KERN_INFO "Initializing PWM class.\n");
-
if (unlikely((ret = class_register(&pwm_class)))) {
printk(KERN_ERR "%s: couldn't register class, exiting\n", DRIVER_NAME);
return ret;
@@ -1192,11 +1195,12 @@ out_sysdev_class:
static void __exit imx_pwm_exit(void)
{
int i;
+
platform_driver_unregister(&imx_pwm_driver);
sysdev_unregister(&pwm_sys_device);
sysdev_class_unregister(&pwm_sysclass);
class_unregister(&pwm_class);
- for(i=0; i<PWM_MAX_DEV; i++)
+ for (i=0; i<PWM_MAX_DEV; i++)
dev_table[i] = NULL;
printk(DRIVER_NAME " successfully unloaded\n");
}
@@ -1206,3 +1210,4 @@ module_exit(imx_pwm_exit);
MODULE_AUTHOR("Julien Boibessot & Sebastien Royen, inspired by a lot of other PWM drivers");
MODULE_DESCRIPTION("i.MX PWM driver");
MODULE_LICENSE("GPL");
+
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-15 08:51:10
|
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 3548856d4e58383048ab017dbd71079720e3867f (commit)
via e9f91f711dc1f6bd11f8a475b04b3a6ee3794efc (commit)
from 7df64044a833c3ee4ed8a3ab61adb9604c26bf4d (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 3548856d4e58383048ab017dbd71079720e3867f
Author: Fabien Marteau <fab...@ar...>
Date: Mon Mar 15 09:49:20 2010 +0100
[as_devices] Coding rules
commit e9f91f711dc1f6bd11f8a475b04b3a6ee3794efc
Author: Fabien Marteau <fab...@ar...>
Date: Mon Mar 15 09:33:43 2010 +0100
[LINUX] Fix comments
-----------------------------------------------------------------------
Summary of changes:
.../063-armadeus-max1027-add_max1027_include.patch | 2 +-
target/packages/as_devices/c/as_max1027.c | 100 ++++++++++++-------
2 files changed, 64 insertions(+), 38 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
index 088df7f..8597057 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
@@ -28,7 +28,7 @@ Index: linux-2.6.29.6/include/linux/spi/max1027.h
+#ifndef __LINUX_SPI_MAX1027_H
+#define __LINUX_SPI_MAX1027_H
+
-+/* 00 :Â Scans channels 0 through N.
++/* 00 : Scans channels 0 through N.
+ * 01 : Scans channels N through the highest numbered channel.
+ * 10 : Scans channel N repeatedly. The averaging register sets the number of results
+ * 11 : No scan. Converts channel N once only. */
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
index 75a8503..8cda042 100644
--- a/target/packages/as_devices/c/as_max1027.c
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -42,7 +42,7 @@ typedef unsigned char u8;
#define SLOW_INPUT_NAME "in%d_input"
#define FAST_INPUT_PATH "/dev/max1027/AIN%d"
-/** @brief Functiun used to write in /sys file
+/** @brief Function used to write in /sys file
*
* @param aFile_handler /sys file handler
* @param aValue int value to write
@@ -65,7 +65,7 @@ int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
perror("Can't write file ");
return -1;
}
- ret = lseek(aFile_handler,0,SEEK_SET);
+ ret = lseek(aFile_handler, 0, SEEK_SET);
if (ret < 0)
{
perror("lseek error ");
@@ -75,10 +75,10 @@ int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
return buffer_len;
}
-/** @brief Functiun used to read int value in /sys file
+/** @brief function used to read int value in /sys file
*
* @param aFile_handler /sys file handler
- * @param aTemperature pointer to temperature read
+ * @param aValueRead pointer to int value read
*
* @return negative value on error,
*/
@@ -127,7 +127,8 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
}
ret = snprintf(path, PATH_SIZE, SYS_PATH, aSpiNum);
- if (ret<0) {
+ if (ret<0)
+ {
printf("Error in path writing\n");
return NULL;
}
@@ -135,27 +136,31 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
/* Open file handler register */
/* conversion */
ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "conversion");
- if (ret<0) {
+ if (ret<0)
+ {
printf("Error in path writing\n");
return NULL;
}
fConversion = open(buffer, O_RDWR);
- if (fConversion < 0){
+ if (fConversion < 0)
+ {
printf("Error, can't open conversion file. Is max1027 modprobed ?\n");
return NULL;
}
/* setup */
ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "setup");
- if (ret<0) {
+ if (ret<0)
+ {
printf("Error in path writing\n");
return NULL;
}
fSetup = open(buffer, O_RDWR);
- if (fSetup < 0){
+ if (fSetup < 0)
+ {
printf("Error, can't open setup file.\n");
return NULL;
}
- ret = as_max1027_write_buffer( fSetup,
+ ret = as_max1027_write_buffer(fSetup,
MAX1027_SETUP |
MAX1027_SETUP_CLKSEL(0) |
MAX1027_SETUP_REFSEL(0) |
@@ -173,20 +178,24 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
}
fAveraging = open(buffer, O_RDWR);
- if (fAveraging < 0){
+ if (fAveraging < 0)
+ {
printf("Error, can't open averaging file.\n");
return NULL;
}
/* temperature */
- if (aMode == AS_MAX1027_SLOW){
+ if (aMode == AS_MAX1027_SLOW)
+ {
ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "temp1_input");
- if (ret<0) {
+ if (ret<0)
+ {
printf("Error in path writing\n");
return NULL;
}
fTemperature = open(buffer, O_RDONLY);
- if (fTemperature < 0){
+ if (fTemperature < 0)
+ {
printf("Error, can't open temperature file.\n");
return NULL;
}
@@ -195,37 +204,44 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
}
/* Open each channels (0 to 6)*/
- for( i=0 ; i<NUMBER_OF_CHANNELS ; i++){
+ for(i=0 ; i<NUMBER_OF_CHANNELS ; i++){
fLowSpeed[i] = -1;
fHighSpeed[i] = -1;
if (aMode == AS_MAX1027_SLOW)
{
ret = snprintf(slow_input_name, 20, SLOW_INPUT_NAME, i);
- if (ret < 0) {
+ if (ret < 0)
+ {
printf("Error in path writing\n");
return NULL;
}
ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, slow_input_name);
- if (ret < 0) {
+ if (ret < 0)
+ {
printf("Error in path writing\n");
return NULL;
}
fLowSpeed[i] = open(buffer, O_RDONLY);
- if (fLowSpeed[i] < 0){
+ if (fLowSpeed[i] < 0)
+ {
printf("Error, can't open %s\n", buffer);
return NULL;
}
- } else if ((aMode == AS_MAX1027_FAST)){
+ }
+ else if ((aMode == AS_MAX1027_FAST))
+ {
ret = snprintf(buffer, BUFFER_SIZE, FAST_INPUT_PATH, i);
- if (ret < 0) {
+ if (ret < 0)
+ {
printf("Error in path writing\n");
return NULL;
}
fHighSpeed[i] = open(buffer, O_RDONLY);
- if (fHighSpeed[i] < 0){
+ if (fHighSpeed[i] < 0)
+ {
printf("Error, can't open %s\nIs loadmax.sh launched ?\n", buffer);
return NULL;
}
@@ -240,7 +256,8 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
dev->fConversion = fConversion;
dev->fSetup = fSetup;
dev->fAveraging = fAveraging;
- for( i=0 ; i<NUMBER_OF_CHANNELS ; i++){
+ for(i=0 ; i<NUMBER_OF_CHANNELS ; i++)
+ {
dev->fLowSpeed[i] = fLowSpeed[i];
dev->fHighSpeed[i] = fHighSpeed[i];
}
@@ -259,7 +276,8 @@ int32_t as_max1027_close(struct as_max1027_device *aDev)
if (aDev->fTemperature > 0) close(aDev->fTemperature);
- for (i=0 ; i<NUMBER_OF_CHANNELS; i++){
+ for (i=0 ; i<NUMBER_OF_CHANNELS; i++)
+ {
if (aDev->fLowSpeed[i] > 0) close(aDev->fLowSpeed[i]);
if (aDev->fHighSpeed[i] > 0) close(aDev->fHighSpeed[i]);
}
@@ -279,19 +297,21 @@ int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
return -1;
/* launch conversion */
- ret = as_max1027_write_buffer( aDev->fConversion,
+ ret = as_max1027_write_buffer(aDev->fConversion,
MAX1027_CONV |
MAX1027_CONV_CHSEL(0) |
MAX1027_CONV_SCAN(aDev->scan_mode) |
MAX1027_CONV_TEMP);
- if (ret < 0){
+ if (ret < 0)
+ {
printf("Error launching conversion\n");
return -1;
}
/* read value */
- ret = as_max1027_read_buffer(aDev->fTemperature,aTemperature);
- if (ret < 0){
+ ret = as_max1027_read_buffer(aDev->fTemperature, aTemperature);
+ if (ret < 0)
+ {
printf("Error, reading fTemperature\n");
return -1;
}
@@ -326,8 +346,9 @@ int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv
/* select averaging */
avg_register |= MAX1027_AVG | MAX1027_AVG_NSCAN(2);
- ret = as_max1027_write_buffer( aDev->fAveraging, avg_register);
- if (ret < 0){
+ ret = as_max1027_write_buffer(aDev->fAveraging, avg_register);
+ if (ret < 0)
+ {
printf("Error, setting averaging\n");
return -1;
}
@@ -347,30 +368,35 @@ int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev,
return -1;
}
- /* temperature is read only on slow mode */
if (aDev->mode == AS_MAX1027_SLOW)
{
/* launch conversion */
- ret = as_max1027_write_buffer( aDev->fConversion,
+ ret = as_max1027_write_buffer(aDev->fConversion,
MAX1027_CONV |
MAX1027_CONV_CHSEL(aChannelNum) |
MAX1027_CONV_SCAN(aDev->scan_mode));
- if (ret < 0){
+ if (ret < 0)
+ {
printf("Error launching conversion\n");
return -1;
}
/* read value */
ret = as_max1027_read_buffer(aDev->fLowSpeed[aChannelNum], aValue);
- if (ret < 0){
- printf("Error, reading fLowSpeed[%d]\n",aChannelNum);
+ if (ret < 0)
+ {
+ printf("Error, reading fLowSpeed[%d]\n", aChannelNum);
return -1;
}
- } else if (aDev->mode == AS_MAX1027_FAST) {
+ }
+ else if (aDev->mode == AS_MAX1027_FAST)
+ {
printf("TODO: fast mode channel reading\n");
return -1;
- } else {
- printf("Uncknow mode\n");
+ }
+ else
+ {
+ printf("Unknown mode\n");
return -1;
}
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-12 13:49:41
|
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 7df64044a833c3ee4ed8a3ab61adb9604c26bf4d (commit)
via 5652018998daa3d4ec754b32c602e42c00611fa7 (commit)
via 94ac755f18c284aba47a5b4b20e10b0e8d50b680 (commit)
from b795039a39ad4b3470d1ef7eb7c30610edb12d32 (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 7df64044a833c3ee4ed8a3ab61adb9604c26bf4d
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 12 14:48:51 2010 +0100
[asdevices] Adding reading channel capability in as_max1027, not tested yet
commit 5652018998daa3d4ec754b32c602e42c00611fa7
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 12 10:30:17 2010 +0100
[asdevices] Adding reading temperature capability in as_max1027
commit 94ac755f18c284aba47a5b4b20e10b0e8d50b680
Author: Fabien Marteau <fab...@ar...>
Date: Thu Mar 11 16:44:13 2010 +0100
[LINUX] Update max1027 header
-----------------------------------------------------------------------
Summary of changes:
.../063-armadeus-max1027-add_max1027_include.patch | 27 ++-
target/packages/as_devices/c/as_max1027.c | 198 ++++++++++++++++++--
target/packages/as_devices/c/as_max1027.h | 49 +++--
target/packages/as_devices/test_c.h | 63 +++++--
4 files changed, 271 insertions(+), 66 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
index 7aa81d7..088df7f 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/063-armadeus-max1027-add_max1027_include.patch
@@ -1,6 +1,8 @@
---- linux-2.6.27.2.ref/include/linux/spi/max1027.h 2008-11-18 06:04:39.000000000 +0100
-+++ linux-2.6.27.2/include/linux/spi/max1027.h 2008-11-18 06:04:39.000000000 +0100
-@@ -0,0 +1,64 @@
+Index: linux-2.6.29.6/include/linux/spi/max1027.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/include/linux/spi/max1027.h 2010-03-11 16:42:01.000000000 +0100
+@@ -0,0 +1,71 @@
+/*
+ * include/linux/spi/max1027.h
+ *
@@ -26,20 +28,27 @@
+#ifndef __LINUX_SPI_MAX1027_H
+#define __LINUX_SPI_MAX1027_H
+
-+#define SCAN_MODE_00 0
-+#define SCAN_MODE_01 1
-+#define SCAN_MODE_10 2
-+#define SCAN_MODE_11 3
++/* 00 :Â Scans channels 0 through N.
++ * 01 : Scans channels N through the highest numbered channel.
++ * 10 : Scans channel N repeatedly. The averaging register sets the number of results
++ * 11 : No scan. Converts channel N once only. */
++#define SCAN_MODE_00 (0)
++#define SCAN_MODE_01 (1)
++#define SCAN_MODE_10 (2)
++#define SCAN_MODE_11 (3)
+
++#define MAX1027_CONV (0x80)
+#define MAX1027_CONV_CHSEL(x) ((x&0x0f)<<3)
+#define MAX1027_CONV_SCAN(x) ((x&0x03)<<1)
-+#define GET_SCAN_MODE(conv) ( (conv & 0x06) >> 1 )
+#define MAX1027_CONV_TEMP 0x01
++#define GET_SCAN_MODE(conv) ( (conv & 0x06) >> 1 )
+
++#define MAX1027_SETUP (0x40)
+#define MAX1027_SETUP_CLKSEL(x) ((x&0x03)<<4)
+#define MAX1027_SETUP_REFSEL(x) ((x&0x03)<<2)
+#define MAX1027_SETUP_DIFFSEL(x) (x&0x03)
+
++#define MAX1027_AVG (0x20)
+#define MAX1027_AVG_AVGON(x) ((x&0x01)<<4)
+#define MAX1027_AVG_NAVG(x) ((x&0x03)<<2)
+#define MAX1027_AVG_NSCAN(x) (x&0x03)
@@ -58,7 +67,7 @@
+ u8 conv; /* initial conversion register value*/
+ u8 setup; /* initial setup register value */
+ u8 avg; /* initial average register value */
-+ int cnvst_pin; /*gpio to start conversion. -1 for software start */
++ int cnvst_pin; /*gpio to start conversion. -1 for software start */
+ int (*init)(struct spi_device *spi);
+ int (*exit)(struct spi_device *spi);
+};
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
index 2ea9d14..75a8503 100644
--- a/target/packages/as_devices/c/as_max1027.c
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -34,6 +34,7 @@ typedef unsigned char u8;
#include <linux/spi/max1027.h>
#include "as_max1027.h"
+
#define BUFFER_SIZE (70)
#define PATH_SIZE (50)
#define SYS_PATH "/sys/bus/spi/devices/spi%d.0/"
@@ -41,6 +42,13 @@ typedef unsigned char u8;
#define SLOW_INPUT_NAME "in%d_input"
#define FAST_INPUT_PATH "/dev/max1027/AIN%d"
+/** @brief Functiun used to write in /sys file
+ *
+ * @param aFile_handler /sys file handler
+ * @param aValue int value to write
+ *
+ * @return negative value on error
+ */
int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
{
int ret;
@@ -67,6 +75,36 @@ int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
return buffer_len;
}
+/** @brief Functiun used to read int value in /sys file
+ *
+ * @param aFile_handler /sys file handler
+ * @param aTemperature pointer to temperature read
+ *
+ * @return negative value on error,
+ */
+int32_t as_max1027_read_buffer(int aFile_handler, int *aValueRead)
+{
+ const int SIZEOFBUFF = 20;
+ ssize_t ret;
+ char valueRead[SIZEOFBUFF];
+ int value;
+
+ ret = read(aFile_handler, valueRead, SIZEOFBUFF);
+ if (ret < 0)
+ {
+ printf("Error, reading buffer file\n");
+ return -1;
+ }
+ valueRead[ret-1] = '\0';
+
+ ret = lseek(aFile_handler, 0, SEEK_SET);
+ if (ret < 0)
+ return -1;
+ value = strtol(valueRead, NULL, 10);
+ *aValueRead = value;
+ return 0;
+}
+
struct as_max1027_device *as_max1027_open(int aSpiNum,
AS_max1027_mode aMode)
{
@@ -74,13 +112,20 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
int i;
int fConversion, fSetup, fAveraging;
int fTemperature;
- int fLowSpeed[8];
- int fHighSpeed[8];
+ int fLowSpeed[NUMBER_OF_CHANNELS];
+ int fHighSpeed[NUMBER_OF_CHANNELS];
char path[PATH_SIZE];
char buffer[BUFFER_SIZE];
char slow_input_name[20];
int ret;
+ /** XXX */
+ if (aMode == AS_MAX1027_FAST)
+ {
+ printf("Error, fast mode not supported yet\n");
+ return NULL;
+ }
+
ret = snprintf(path, PATH_SIZE, SYS_PATH, aSpiNum);
if (ret<0) {
printf("Error in path writing\n");
@@ -110,12 +155,23 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
printf("Error, can't open setup file.\n");
return NULL;
}
- /* setup */
+ ret = as_max1027_write_buffer( fSetup,
+ MAX1027_SETUP |
+ MAX1027_SETUP_CLKSEL(0) |
+ MAX1027_SETUP_REFSEL(0) |
+ MAX1027_SETUP_DIFFSEL(0));
+ if (ret < 0)
+ {
+ printf("Error, can't set default setup parameters\n");
+ return NULL;
+ }
+ /* averaging */
ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "averaging");
if (ret<0) {
printf("Error in path writing\n");
return NULL;
}
+
fAveraging = open(buffer, O_RDWR);
if (fAveraging < 0){
printf("Error, can't open averaging file.\n");
@@ -123,18 +179,23 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
}
/* temperature */
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "temperature");
- if (ret<0) {
- printf("Error in path writing\n");
- return NULL;
- }
- fTemperature = open(buffer, O_RDWR);
- if (fAveraging < 0){
- printf("Error, can't open temperature file.\n");
- return NULL;
+ if (aMode == AS_MAX1027_SLOW){
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "temp1_input");
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+ fTemperature = open(buffer, O_RDONLY);
+ if (fTemperature < 0){
+ printf("Error, can't open temperature file.\n");
+ return NULL;
+ }
+ } else {
+ fTemperature = -1;
}
- for( i=0 ; i<8 ; i++){
+ /* Open each channels (0 to 6)*/
+ for( i=0 ; i<NUMBER_OF_CHANNELS ; i++){
fLowSpeed[i] = -1;
fHighSpeed[i] = -1;
if (aMode == AS_MAX1027_SLOW)
@@ -156,7 +217,7 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
printf("Error, can't open %s\n", buffer);
return NULL;
}
- }else if((aMode == AS_MAX1027_FAST) && (i<7)){
+ } else if ((aMode == AS_MAX1027_FAST)){
ret = snprintf(buffer, BUFFER_SIZE, FAST_INPUT_PATH, i);
if (ret < 0) {
printf("Error in path writing\n");
@@ -175,14 +236,16 @@ struct as_max1027_device *as_max1027_open(int aSpiNum,
dev = (struct as_max1027_device *)malloc(sizeof(struct as_max1027_device));
dev->mode = aMode;
+ dev->scan_mode = SCAN_MODE_11;
dev->fConversion = fConversion;
dev->fSetup = fSetup;
dev->fAveraging = fAveraging;
- for( i=0 ; i<8 ; i++){
+ for( i=0 ; i<NUMBER_OF_CHANNELS ; i++){
dev->fLowSpeed[i] = fLowSpeed[i];
dev->fHighSpeed[i] = fHighSpeed[i];
}
dev->fTemperature = fTemperature;
+
return dev;
}
@@ -196,24 +259,121 @@ int32_t as_max1027_close(struct as_max1027_device *aDev)
if (aDev->fTemperature > 0) close(aDev->fTemperature);
- for (i=0 ; i<8; i++){
+ for (i=0 ; i<NUMBER_OF_CHANNELS; i++){
if (aDev->fLowSpeed[i] > 0) close(aDev->fLowSpeed[i]);
if (aDev->fHighSpeed[i] > 0) close(aDev->fHighSpeed[i]);
}
free(aDev);
+
return 0;
}
-int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev)
+int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
+ int *aTemperature)
{
- uint8_t setup_value;
+ int32_t ret;
/* temperature is read only on slow mode */
if (aDev->mode != AS_MAX1027_SLOW)
return -1;
+ /* launch conversion */
+ ret = as_max1027_write_buffer( aDev->fConversion,
+ MAX1027_CONV |
+ MAX1027_CONV_CHSEL(0) |
+ MAX1027_CONV_SCAN(aDev->scan_mode) |
+ MAX1027_CONV_TEMP);
+ if (ret < 0){
+ printf("Error launching conversion\n");
+ return -1;
+ }
+
+ /* read value */
+ ret = as_max1027_read_buffer(aDev->fTemperature,aTemperature);
+ if (ret < 0){
+ printf("Error, reading fTemperature\n");
+ return -1;
+ }
-
return 0;
}
+
+int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv){
+ uint8_t avg_register = 0;
+ int ret;
+
+ switch (aNbConv)
+ {
+ case 1: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(0);
+ aDev->scan_mode = SCAN_MODE_11; /* no scan */
+ break;
+ case 4: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 8: avg_register = MAX1027_AVG_NAVG(1) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 16: avg_register = MAX1027_AVG_NAVG(2) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 32: avg_register = MAX1027_AVG_NAVG(3) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ default: printf("%s: unsupported setting\n", __func__);
+ return -1;
+ }
+
+ /* select averaging */
+ avg_register |= MAX1027_AVG | MAX1027_AVG_NSCAN(2);
+ ret = as_max1027_write_buffer( aDev->fAveraging, avg_register);
+ if (ret < 0){
+ printf("Error, setting averaging\n");
+ return -1;
+ }
+
+ return aNbConv;
+}
+
+
+int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev,
+ int aChannelNum, int *aValue)
+{
+ int32_t ret;
+
+ if ((aChannelNum >= NUMBER_OF_CHANNELS) || (aChannelNum < 0))
+ {
+ printf("Wrong num channel\n");
+ return -1;
+ }
+
+ /* temperature is read only on slow mode */
+ if (aDev->mode == AS_MAX1027_SLOW)
+ {
+ /* launch conversion */
+ ret = as_max1027_write_buffer( aDev->fConversion,
+ MAX1027_CONV |
+ MAX1027_CONV_CHSEL(aChannelNum) |
+ MAX1027_CONV_SCAN(aDev->scan_mode));
+ if (ret < 0){
+ printf("Error launching conversion\n");
+ return -1;
+ }
+
+ /* read value */
+ ret = as_max1027_read_buffer(aDev->fLowSpeed[aChannelNum], aValue);
+ if (ret < 0){
+ printf("Error, reading fLowSpeed[%d]\n",aChannelNum);
+ return -1;
+ }
+ } else if (aDev->mode == AS_MAX1027_FAST) {
+ printf("TODO: fast mode channel reading\n");
+ return -1;
+ } else {
+ printf("Uncknow mode\n");
+ return -1;
+ }
+
+ return 0;
+}
+
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
index 7f4d1ff..5832151 100644
--- a/target/packages/as_devices/c/as_max1027.h
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -3,18 +3,18 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* 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
*
*
- * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
+ * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
*
*/
@@ -22,7 +22,7 @@
#define AS_MAX1027_H_
/** @file
- * @brief Read/Write analog value with max1027 chip
+ * @brief Read/Write analog value with max1027 chip
*
*
*/
@@ -31,6 +31,8 @@
extern "C" {
#endif
+#define NUMBER_OF_CHANNELS (7)
+
typedef enum {
AS_MAX1027_FAST,
AS_MAX1027_SLOW
@@ -41,12 +43,14 @@ typedef enum {
*/
struct as_max1027_device {
AS_max1027_mode mode;
- int fConversion; /**< File handler for conversion register */
- int fSetup; /**< File handler for setup register */
- int fAveraging; /**< File handler for averaging register */
- int fLowSpeed[8]; /**< Files handlers for lowspeed input interface */
- int fHighSpeed[8]; /**< Files handlers for high speed input interface */
- int fTemperature; /**< File handler for temperature */
+ uint8_t scan_mode;
+ uint8_t fConversion; /**< File handler for conversion register */
+ uint8_t fSetup; /**< File handler for setup register */
+ uint8_t fAveraging; /**< File handler for averaging register */
+ uint8_t fLowSpeed[NUMBER_OF_CHANNELS]; /**< Files handlers for lowspeed */
+ uint8_t fHighSpeed[NUMBER_OF_CHANNELS]; /**< Files handlers for high speed */
+ uint8_t fTemperature; /**< File handler for temperature */
+
};
/** @brief Open max1027
@@ -54,9 +58,9 @@ struct as_max1027_device {
* @param aSpiNum spi bus number used
* @param aMode enum to set mode (fast or slow)
*
- * @return as_max1027_device structure pointer, NULL if error
+ * @return as_max1027_device structure pointer, NULL if error
*/
-struct as_max1027_device *as_max1027_open(int aSpiNum,
+struct as_max1027_device *as_max1027_open(int aSpiNum,
AS_max1027_mode aMode);
/** @brief Close max1027
@@ -70,29 +74,36 @@ int32_t as_max1027_close(struct as_max1027_device *aDev);
/** @brief set averaging measurement
*
- * @param
+ * @param as_max1027_device structure pointer.
+ * @param aNbConv number of conversions to do for the averaging (4, 8, 16, 32). Set to 1 for disabling averaging.
*
- * @return negative value on error
+ * @return negative value on error and aNbConv on success
*/
-int32_t as_max1027_set_averaging(struct as_max1027_device *aDev);
+int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv);
/** @brief read temperature in milidegree â°C
*
- * @param
+ * @param as_max1027_device structure pointer.
+ * @param aTemperature pointer for temperature result.
*
* @return negative value on error
*
* @note Only slow mode can read temperature value.
*/
-int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev);
+int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
+ int *aTemperature);
/** @brief read milivoltage value
*
- * @param
+ * @param as_max1027_device structure pointer.
+ * @param aChannelNum channel number to read.
+ * @param *aValue pointer to returned value.
*
* @return negative value on error
*/
-int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev);
+int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev,
+ int aChannelNum,
+ int *aValue);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index 6f6aa5f..fe9c040 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -1,19 +1,19 @@
/*
** THE ARMadeus Systems
- **
- ** Copyright (C) 2009 The armadeus systems team
+ **
+ ** Copyright (C) 2009 The armadeus systems team
** Fabien Marteau <fab...@ar...>
- **
+ **
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
- **
+ **
** This library 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
** Lesser General Public License for more details.
- **
+ **
** 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
@@ -35,7 +35,7 @@ void pressEnterToContinue(void)
{
printf("\nPress enter to continue\n");
while( getc(stdin) != '\n');
- while( getc(stdin) != '\n');
+ while( getc(stdin) != '\n');
}
/* pwm test */
@@ -303,9 +303,9 @@ void test_93LC()
scanf("%s", spidevpath);
printf("New path is %s\n",spidevpath);
break;
- case '5' : dev = as_93lcxx_open((unsigned char *)spidevpath,
- type,
- frequency,
+ case '5' : dev = as_93lcxx_open((unsigned char *)spidevpath,
+ type,
+ frequency,
word_size);
if (dev == NULL)
{
@@ -320,7 +320,7 @@ void test_93LC()
} else {
switch(buffer[0])
{
- case '1' : as_93lcxx_close(dev);
+ case '1' : as_93lcxx_close(dev);
printf("eeprom closed\n");
initialized = 0;
pressEnterToContinue();
@@ -397,7 +397,7 @@ void test_93LC()
{
printf("%03X -> %02X\n",
i,as_93lcxx_read(dev, i));
- } else{
+ } else{
printf("%03X -> %04X\n",
i,as_93lcxx_read(dev, i));
}
@@ -547,7 +547,7 @@ void test_gpio()
port_value = ret;
pressEnterToContinue();
break;
-
+
default : break;
}
}
@@ -569,10 +569,14 @@ void test_max1027()
int ret;
char c_value[10];
int value;
+ int averaging=1;
+ int temperature = 0;
+ int temp_read=0;
struct as_max1027_device *max1027_dev;
int channel=0;
AS_max1027_mode mode= AS_MAX1027_SLOW;
+
max1027_dev = as_max1027_open(MAX1027_SPI_NUM, mode);
if (max1027_dev == NULL)
{
@@ -580,18 +584,20 @@ void test_max1027()
pressEnterToContinue();
return ;
}
+ pressEnterToContinue();
while(buffer[0] != 'q')
{
system("clear");
printf("**************************\n");
- printf(" Testing max1027 *\n");
+ printf(" Testing max1027 *\n");
printf("**************************\n");
printf("Choose ('q' to quit):\n");
printf(" 1) Change mode (%s)\n",(mode == AS_MAX1027_SLOW)?"SLOW":"FAST");
printf(" 2) Select channel (%d)\n", channel);
- printf(" 3) Read channel value\n");
- printf(" 4) Read temperature\n");
+ printf(" 3) Set averaging (%d)\n", averaging);
+ printf(" 4) Read channel value\n");
+ printf(" 5) Read temperature\n");
printf("> ");
scanf("%s",buffer);
@@ -602,7 +608,7 @@ void test_max1027()
scanf("%s",c_value);
if ((c_value[0]=='s') && (mode == AS_MAX1027_FAST)){
as_max1027_close(max1027_dev);
- max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
+ max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
AS_MAX1027_SLOW);
if (max1027_dev == NULL){
printf("Error, can't open max1027 in slow mode\n");
@@ -613,7 +619,7 @@ void test_max1027()
printf("Mode changed to Slow\n");
} else if((c_value[0] == 'f') && (mode == AS_MAX1027_SLOW)){
as_max1027_close(max1027_dev);
- max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
+ max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
AS_MAX1027_FAST);
if (max1027_dev == NULL){
printf("Error, can't open max1027 in fast mode\n");
@@ -633,11 +639,30 @@ void test_max1027()
}
channel = value;
break;
- case '3' : printf("TODO");
+ case '3' : printf("Give averaging (1, 4, 8, 16, 32): ");
+ scanf("%d", &value);
+ ret = as_max1027_set_averaging(max1027_dev, value);
+ if (ret < 0)
+ {
+ printf("Error, can't set averaging\n");
+ pressEnterToContinue();
+ break;
+ }
+ averaging = value;
+ pressEnterToContinue();
break;
case '4' : printf("TODO");
break;
-
+ case '5' : ret = as_max1027_read_temperature_mC(max1027_dev, &temp_read);
+ if (ret < 0) {
+ printf("Error reading temperature\n");
+ pressEnterToContinue();
+ break;
+ }
+ temperature = temp_read;
+ printf("Temperature read in miliâ°C : %d\n", temperature);
+ pressEnterToContinue();
+ break;
default : break;
}
}
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-10 18:12: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 b795039a39ad4b3470d1ef7eb7c30610edb12d32 (commit)
via 2254dc3452203ef6042a1dec1fe29b843bff9d7b (commit)
via d66207896d59250512335867d75d839609ea7d7a (commit)
from c42c8e2da1c3197b381ac1ddd36afd5f26d51f33 (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 b795039a39ad4b3470d1ef7eb7c30610edb12d32
Merge: 2254dc3452203ef6042a1dec1fe29b843bff9d7b c42c8e2da1c3197b381ac1ddd36afd5f26d51f33
Author: Fabien Marteau <fab...@ar...>
Date: Wed Mar 10 19:11:36 2010 +0100
Merge branch 'master' of ssh://fabm@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 2254dc3452203ef6042a1dec1fe29b843bff9d7b
Author: Fabien Marteau <fab...@ar...>
Date: Wed Mar 10 19:09:14 2010 +0100
[asdevices] Adding test for max1027
commit d66207896d59250512335867d75d839609ea7d7a
Author: Fabien Marteau <fab...@ar...>
Date: Wed Mar 10 14:25:14 2010 +0100
[as_devices] fix makefile platform variable
-----------------------------------------------------------------------
Summary of changes:
.../package/armadeus/as_devices/as_devices.mk | 3 +-
target/packages/as_devices/c/Makefile | 17 +-
target/packages/as_devices/c/as_max1027.c | 197 +++++++++++++++++++-
target/packages/as_devices/c/as_max1027.h | 51 ++++-
target/packages/as_devices/main.c | 3 +
target/packages/as_devices/test_c.h | 101 ++++++++++-
6 files changed, 351 insertions(+), 21 deletions(-)
diff --git a/buildroot/package/armadeus/as_devices/as_devices.mk b/buildroot/package/armadeus/as_devices/as_devices.mk
index d1adee1..714161d 100644
--- a/buildroot/package/armadeus/as_devices/as_devices.mk
+++ b/buildroot/package/armadeus/as_devices/as_devices.mk
@@ -42,7 +42,8 @@ $(AS_DEVICES_DIR)/Makefile:
# Compile as_devices library using the makefile
$(AS_DEVICES_DIR)/c/$(AS_DEVICES_BINARY): $(AS_DEVICES_DIR)/Makefile
- $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(AS_DEVICES_DIR)/c
+ #XXX: BR2_TARGET_UBOOT_BOARDNAME is wrong, to be fixed
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(AS_DEVICES_DIR)/c ARMADEUS_BOARD_NAME=$(BR2_TARGET_UBOOT_BOARDNAME)
# install library on target
$(TARGET_DIR)/$(AS_DEVICES_TARGET_BINARY): $(AS_DEVICES_DIR)/c/$(AS_DEVICES_BINARY)
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 6ab4854..bf59fa8 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -1,20 +1,25 @@
# Default values for local compiling:
#
+ifeq ($(KERNEL_INCLUDE),)
ARMADEUS_BASE_DIR=../../../../
include $(ARMADEUS_BASE_DIR)/Makefile.in
+KERNEL_INCLUDE=$(ARMADEUS_LINUX_DIR)/include/
+CFLAGS+= -Wall -g -O0
+CFLAGS+= -I$(KERNEL_INCLUDE)
+endif
+
+LDFLAGS=
+CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
ifeq ($(ARMADEUS_BOARD_NAME),apf9328)
-CFLAGS=-Wall -g -O0 -DAPF9328
+CFLAGS+= -DAPF9328
endif
ifeq ($(ARMADEUS_BOARD_NAME),apf27)
-CFLAGS=-Wall -g -O0 -DAPF27
+CFLAGS+= -DAPF27
endif
-LDFLAGS=
-CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
-STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
-
OBJ=as_pwm.o
OBJ+= as_i2c.o
OBJ+= as_gpio.o
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
index b243188..2ea9d14 100644
--- a/target/packages/as_devices/c/as_max1027.c
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -3,26 +3,217 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
- *
+ *
* This library 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
* Lesser General Public License for more details.
- *
+ *
* 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
*
*
- * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
+ * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
*
*/
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include <unistd.h>
+#include <linux/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+///XXX: find where u8 is defined under linux
+typedef unsigned char u8;
+#include <linux/spi/max1027.h>
#include "as_max1027.h"
+#define BUFFER_SIZE (70)
+#define PATH_SIZE (50)
+#define SYS_PATH "/sys/bus/spi/devices/spi%d.0/"
+#define TEMP_NAME "temp1_input"
+#define SLOW_INPUT_NAME "in%d_input"
+#define FAST_INPUT_PATH "/dev/max1027/AIN%d"
+
+int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
+{
+ int ret;
+ char buffer[50];
+ int buffer_len;
+
+ ret = snprintf(buffer, 50, "%d", aValue);
+ if (ret < 0)
+ return -1;
+ buffer_len = strlen(buffer);
+ ret = write(aFile_handler, buffer, buffer_len);
+ if (ret < 0)
+ {
+ perror("Can't write file ");
+ return -1;
+ }
+ ret = lseek(aFile_handler,0,SEEK_SET);
+ if (ret < 0)
+ {
+ perror("lseek error ");
+ return -1;
+ }
+
+ return buffer_len;
+}
+
+struct as_max1027_device *as_max1027_open(int aSpiNum,
+ AS_max1027_mode aMode)
+{
+ struct as_max1027_device *dev;
+ int i;
+ int fConversion, fSetup, fAveraging;
+ int fTemperature;
+ int fLowSpeed[8];
+ int fHighSpeed[8];
+ char path[PATH_SIZE];
+ char buffer[BUFFER_SIZE];
+ char slow_input_name[20];
+ int ret;
+
+ ret = snprintf(path, PATH_SIZE, SYS_PATH, aSpiNum);
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+
+ /* Open file handler register */
+ /* conversion */
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "conversion");
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+ fConversion = open(buffer, O_RDWR);
+ if (fConversion < 0){
+ printf("Error, can't open conversion file. Is max1027 modprobed ?\n");
+ return NULL;
+ }
+ /* setup */
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "setup");
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+ fSetup = open(buffer, O_RDWR);
+ if (fSetup < 0){
+ printf("Error, can't open setup file.\n");
+ return NULL;
+ }
+ /* setup */
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "averaging");
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+ fAveraging = open(buffer, O_RDWR);
+ if (fAveraging < 0){
+ printf("Error, can't open averaging file.\n");
+ return NULL;
+ }
+
+ /* temperature */
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "temperature");
+ if (ret<0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+ fTemperature = open(buffer, O_RDWR);
+ if (fAveraging < 0){
+ printf("Error, can't open temperature file.\n");
+ return NULL;
+ }
+
+ for( i=0 ; i<8 ; i++){
+ fLowSpeed[i] = -1;
+ fHighSpeed[i] = -1;
+ if (aMode == AS_MAX1027_SLOW)
+ {
+ ret = snprintf(slow_input_name, 20, SLOW_INPUT_NAME, i);
+ if (ret < 0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+
+ ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, slow_input_name);
+ if (ret < 0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+
+ fLowSpeed[i] = open(buffer, O_RDONLY);
+ if (fLowSpeed[i] < 0){
+ printf("Error, can't open %s\n", buffer);
+ return NULL;
+ }
+ }else if((aMode == AS_MAX1027_FAST) && (i<7)){
+ ret = snprintf(buffer, BUFFER_SIZE, FAST_INPUT_PATH, i);
+ if (ret < 0) {
+ printf("Error in path writing\n");
+ return NULL;
+ }
+
+ fHighSpeed[i] = open(buffer, O_RDONLY);
+ if (fHighSpeed[i] < 0){
+ printf("Error, can't open %s\nIs loadmax.sh launched ?\n", buffer);
+ return NULL;
+ }
+
+ }
+ }
+
+ dev = (struct as_max1027_device *)malloc(sizeof(struct as_max1027_device));
+
+ dev->mode = aMode;
+ dev->fConversion = fConversion;
+ dev->fSetup = fSetup;
+ dev->fAveraging = fAveraging;
+ for( i=0 ; i<8 ; i++){
+ dev->fLowSpeed[i] = fLowSpeed[i];
+ dev->fHighSpeed[i] = fHighSpeed[i];
+ }
+ dev->fTemperature = fTemperature;
+ return dev;
+}
+
+int32_t as_max1027_close(struct as_max1027_device *aDev)
+{
+ int i;
+
+ if (aDev->fConversion > 0) close(aDev->fConversion);
+ if (aDev->fSetup > 0) close(aDev->fSetup);
+ if (aDev->fAveraging > 0) close(aDev->fAveraging);
+
+ if (aDev->fTemperature > 0) close(aDev->fTemperature);
+
+ for (i=0 ; i<8; i++){
+ if (aDev->fLowSpeed[i] > 0) close(aDev->fLowSpeed[i]);
+ if (aDev->fHighSpeed[i] > 0) close(aDev->fHighSpeed[i]);
+ }
+
+ free(aDev);
+ return 0;
+}
+
+int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev)
+{
+ uint8_t setup_value;
+
+ /* temperature is read only on slow mode */
+ if (aDev->mode != AS_MAX1027_SLOW)
+ return -1;
+
+ return 0;
+}
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
index 524f060..7f4d1ff 100644
--- a/target/packages/as_devices/c/as_max1027.h
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -41,25 +41,58 @@ typedef enum {
*/
struct as_max1027_device {
AS_max1027_mode mode;
+ int fConversion; /**< File handler for conversion register */
+ int fSetup; /**< File handler for setup register */
+ int fAveraging; /**< File handler for averaging register */
+ int fLowSpeed[8]; /**< Files handlers for lowspeed input interface */
+ int fHighSpeed[8]; /**< Files handlers for high speed input interface */
+ int fTemperature; /**< File handler for temperature */
};
-
/** @brief Open max1027
*
- * @param aSpiNum spi bus number used
+ * @param aSpiNum spi bus number used
+ * @param aMode enum to set mode (fast or slow)
*
* @return as_max1027_device structure pointer, NULL if error
*/
struct as_max1027_device *as_max1027_open(int aSpiNum,
- AS_max1027_mode mode);
+ AS_max1027_mode aMode);
+
+/** @brief Close max1027
+ *
+ * @param aDev structure device pointer
+ *
+ * @return negative value on error
+ */
+int32_t as_max1027_close(struct as_max1027_device *aDev);
-//setAveraging();
-//readTemperature_mC();
-//readTemperature_C();
-//
-//getValueInMilliVolt();
-//getValueInVolt();
+/** @brief set averaging measurement
+ *
+ * @param
+ *
+ * @return negative value on error
+ */
+int32_t as_max1027_set_averaging(struct as_max1027_device *aDev);
+
+/** @brief read temperature in milidegree â°C
+ *
+ * @param
+ *
+ * @return negative value on error
+ *
+ * @note Only slow mode can read temperature value.
+ */
+int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev);
+
+/** @brief read milivoltage value
+ *
+ * @param
+ *
+ * @return negative value on error
+ */
+int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/main.c b/target/packages/as_devices/main.c
index e74c9b9..f261c14 100644
--- a/target/packages/as_devices/main.c
+++ b/target/packages/as_devices/main.c
@@ -42,6 +42,7 @@ int main(int argc, char ** argv)
printf(" 3) Testing spi\n");
printf(" 4) Testing 93LCxx eprom\n");
printf(" 5) Testing gpio\n");
+ printf(" 6) Testing max1027\n");
printf("> ");
scanf("%s",buffer);
@@ -57,6 +58,8 @@ int main(int argc, char ** argv)
break;
case '5' : test_gpio();
break;
+ case '6' : test_max1027();
+ break;
default : break;
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index 54be388..6f6aa5f 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -27,14 +27,15 @@
#include "as_93lcxx.h"
#include "as_i2c.h"
#include "as_gpio.h"
+#include "as_max1027.h"
#define PWM_NUM 0
void pressEnterToContinue(void)
{
printf("\nPress enter to continue\n");
- getc(stdin);//XXX
- while( getc(stdin) != '\n') ;
+ while( getc(stdin) != '\n');
+ while( getc(stdin) != '\n');
}
/* pwm test */
@@ -552,4 +553,100 @@ void test_gpio()
}
}
+#ifdef APF9328
+# define MAX1027_SPI_NUM (1)
+#elif defined(APF27)
+# define MAX1027_SPI_NUM (0)
+#else
+#error Error no platform defined
+#endif
+
+#define NUM_OF_CHANNEL (8)
+
+void test_max1027()
+{
+ char buffer[50];
+ int ret;
+ char c_value[10];
+ int value;
+ struct as_max1027_device *max1027_dev;
+ int channel=0;
+ AS_max1027_mode mode= AS_MAX1027_SLOW;
+
+ max1027_dev = as_max1027_open(MAX1027_SPI_NUM, mode);
+ if (max1027_dev == NULL)
+ {
+ printf("Error, can't open max1027. Is max1027 modprobed ?\n");
+ pressEnterToContinue();
+ return ;
+ }
+
+ while(buffer[0] != 'q')
+ {
+ system("clear");
+ printf("**************************\n");
+ printf(" Testing max1027 *\n");
+ printf("**************************\n");
+ printf("Choose ('q' to quit):\n");
+ printf(" 1) Change mode (%s)\n",(mode == AS_MAX1027_SLOW)?"SLOW":"FAST");
+ printf(" 2) Select channel (%d)\n", channel);
+ printf(" 3) Read channel value\n");
+ printf(" 4) Read temperature\n");
+
+ printf("> ");
+ scanf("%s",buffer);
+
+ switch(buffer[0])
+ {
+ case '1' : printf("Give mode wanted (s:SLOW, f:FAST): ");
+ scanf("%s",c_value);
+ if ((c_value[0]=='s') && (mode == AS_MAX1027_FAST)){
+ as_max1027_close(max1027_dev);
+ max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
+ AS_MAX1027_SLOW);
+ if (max1027_dev == NULL){
+ printf("Error, can't open max1027 in slow mode\n");
+ pressEnterToContinue();
+ break;
+ }
+ mode = AS_MAX1027_SLOW;
+ printf("Mode changed to Slow\n");
+ } else if((c_value[0] == 'f') && (mode == AS_MAX1027_SLOW)){
+ as_max1027_close(max1027_dev);
+ max1027_dev = as_max1027_open(MAX1027_SPI_NUM,
+ AS_MAX1027_FAST);
+ if (max1027_dev == NULL){
+ printf("Error, can't open max1027 in fast mode\n");
+ pressEnterToContinue();
+ break;
+ }
+ mode = AS_MAX1027_FAST;
+ printf("Mode changed to Fast\n");
+ }
+ pressEnterToContinue();
+ break;
+ case '2' : printf("Give channel you want to read (0-8): ");
+ scanf("%d",&value);
+ if ((value >= NUM_OF_CHANNEL) || (value < 0)){
+ printf("Channel num wrong\n");
+ break;
+ }
+ channel = value;
+ break;
+ case '3' : printf("TODO");
+ break;
+ case '4' : printf("TODO");
+ break;
+
+ default : break;
+ }
+ }
+
+ ret = as_max1027_close(max1027_dev);
+ if (ret < 0) {
+ printf("Error on closing max1027\n");
+ pressEnterToContinue();
+ }
+}
+
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-10 13:34:20
|
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 c42c8e2da1c3197b381ac1ddd36afd5f26d51f33 (commit)
from f2f4048bd931f2f28b09a23eb5fa0b2aa733a58a (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 c42c8e2da1c3197b381ac1ddd36afd5f26d51f33
Author: Julien Boibessot <jul...@ar...>
Date: Wed Mar 10 14:21:48 2010 +0100
[DEBUG] Cleanup imxregs build
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/imxregs/imxregs.mk | 8 ++++++--
target/linux/debug/imxregs/Makefile | 5 ++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/buildroot/package/armadeus/imxregs/imxregs.mk b/buildroot/package/armadeus/imxregs/imxregs.mk
index cf53e19..e1da229 100644
--- a/buildroot/package/armadeus/imxregs/imxregs.mk
+++ b/buildroot/package/armadeus/imxregs/imxregs.mk
@@ -11,7 +11,11 @@ IMXREGS_CAT:=zcat
ifeq ($(BR2_TARGET_ARMADEUS_APF27),y)
IMXREGS_BINARY:=imx27regs
else
-IMXREGS_BINARY:=imxregs
+ ifeq ($(BR2_TARGET_ARMADEUS_APF9328),y)
+ IMXREGS_BINARY:=imxregs
+ else
+ IMXREGS_BINARY:=unknown_arch
+ endif
endif
IMXREGS_TARGET_BINARY:=usr/bin/imxregs
@@ -20,7 +24,7 @@ $(IMXREGS_DIR)/imxregs.c:
cp $(IMXREGS_SOURCE)/* $(IMXREGS_DIR)/
$(IMXREGS_DIR)/$(IMXREGS_BINARY): $(IMXREGS_DIR)/imxregs.c
- $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(IMXREGS_DIR)
+ $(MAKE) CC=$(TARGET_CC) -C $(IMXREGS_DIR)
$(TARGET_DIR)/$(IMXREGS_TARGET_BINARY): $(IMXREGS_DIR)/$(IMXREGS_BINARY)
install -D $< $@
diff --git a/target/linux/debug/imxregs/Makefile b/target/linux/debug/imxregs/Makefile
index 17e101f..5ca78a1 100644
--- a/target/linux/debug/imxregs/Makefile
+++ b/target/linux/debug/imxregs/Makefile
@@ -1,6 +1,5 @@
-ifeq ($(CC),cc)
- CC=arm-linux-gcc
-endif
+CC=arm-linux-gcc
+
all: imxregs imx27regs
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-09 08:47:04
|
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 f2f4048bd931f2f28b09a23eb5fa0b2aa733a58a (commit)
via 3b240cb25e36fc7f208960d5c075655c7cfa9a55 (commit)
from e5124b09ce5422e7d4c084d0f1ae137c570c61bd (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 f2f4048bd931f2f28b09a23eb5fa0b2aa733a58a
Merge: 3b240cb25e36fc7f208960d5c075655c7cfa9a55 e5124b09ce5422e7d4c084d0f1ae137c570c61bd
Author: Fabien Marteau <fab...@ar...>
Date: Tue Mar 9 09:45:25 2010 +0100
Merge branch 'master' of ssh://fabm@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 3b240cb25e36fc7f208960d5c075655c7cfa9a55
Author: Fabien Marteau <fab...@ar...>
Date: Tue Mar 9 09:43:39 2010 +0100
[asdevices] Add platform parameter in compilation
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/Makefile | 9 ++++++++-
target/packages/as_devices/c/Makefile | 9 ++++++++-
target/packages/as_devices/c/as_gpio.c | 7 +++++++
target/packages/as_devices/c/as_gpio.h | 2 +-
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/target/packages/as_devices/Makefile b/target/packages/as_devices/Makefile
index b3578d4..fd18837 100644
--- a/target/packages/as_devices/Makefile
+++ b/target/packages/as_devices/Makefile
@@ -2,7 +2,14 @@
ARMADEUS_BASE_DIR=../../../
include $(ARMADEUS_BASE_DIR)/Makefile.in
-CFLAGS=-Wall -g -O0
+ifeq ($(ARMADEUS_BOARD_NAME),apf9328)
+CFLAGS=-Wall -g -O0 -DAPF9328
+else
+ifeq ($(ARMADEUS_BOARD_NAME),apf27)
+CFLAGS=-Wall -g -O0 -DAPF27
+endif
+endif
+
LDFLAGS=
CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
CXX:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 816efe6..6ab4854 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -3,7 +3,14 @@
ARMADEUS_BASE_DIR=../../../../
include $(ARMADEUS_BASE_DIR)/Makefile.in
-CFLAGS=-Wall -g -O0
+ifeq ($(ARMADEUS_BOARD_NAME),apf9328)
+CFLAGS=-Wall -g -O0 -DAPF9328
+endif
+
+ifeq ($(ARMADEUS_BOARD_NAME),apf27)
+CFLAGS=-Wall -g -O0 -DAPF27
+endif
+
LDFLAGS=
CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
diff --git a/target/packages/as_devices/c/as_gpio.c b/target/packages/as_devices/c/as_gpio.c
index bf8422b..34a7c9a 100644
--- a/target/packages/as_devices/c/as_gpio.c
+++ b/target/packages/as_devices/c/as_gpio.c
@@ -38,6 +38,13 @@
#define GPIO_BASE_PORT ("/dev/gpio/port")
+#ifdef APF9328
+# define NUMBER_OF_PORTS 4
+#elif defined(APF27)
+# define NUMBER_OF_PORTS 6
+#else
+#error Error no platform defined
+#endif
/*------------------------------------------------------------------------------*/
diff --git a/target/packages/as_devices/c/as_gpio.h b/target/packages/as_devices/c/as_gpio.h
index 3ed3b9e..4b98c84 100644
--- a/target/packages/as_devices/c/as_gpio.h
+++ b/target/packages/as_devices/c/as_gpio.h
@@ -28,7 +28,7 @@
extern "C" {
#endif // __cplusplus
-#define NUMBER_OF_PORTS 6
+//TODO: manage irq
/**
* Store gpio parameters
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-05 22:31: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 e5124b09ce5422e7d4c084d0f1ae137c570c61bd (commit)
via e63d8f38a2128633ba2f49780c1950664943e0e2 (commit)
from 56f57d7811f2e5784776ee15bf7a9364cba497b2 (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 e5124b09ce5422e7d4c084d0f1ae137c570c61bd
Merge: e63d8f38a2128633ba2f49780c1950664943e0e2 56f57d7811f2e5784776ee15bf7a9364cba497b2
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 5 23:30:22 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit e63d8f38a2128633ba2f49780c1950664943e0e2
Author: Julien Boibessot <jul...@ar...>
Date: Fri Mar 5 23:29:37 2010 +0100
Indentation
-----------------------------------------------------------------------
Summary of changes:
.../user_space/sleep/pulse_linux_userspace_sleep.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/target/demos/real_time/pulse/linux/user_space/sleep/pulse_linux_userspace_sleep.c b/target/demos/real_time/pulse/linux/user_space/sleep/pulse_linux_userspace_sleep.c
index 3c48275..e61d05e 100644
--- a/target/demos/real_time/pulse/linux/user_space/sleep/pulse_linux_userspace_sleep.c
+++ b/target/demos/real_time/pulse/linux/user_space/sleep/pulse_linux_userspace_sleep.c
@@ -1,5 +1,5 @@
/*
-* linux user space apps for generating signl with sleep
+* Linux user space app for generating a pulse (using sleep)
*
* Copyright (C) 2009 <gwe...@ar...>
* Armadeus Project / Armadeus Systems
@@ -28,22 +28,27 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
+
#include "../../../../common.h"
-int main(int argc, char **argv) {
- int fd, iomask;
- if ((fd = open(PULSE_OUTPUT_DEV, O_RDWR))<0) {
+
+int main(/*int argc, char **argv*/void)
+{
+ int fd, iomask;
+
+ if ((fd=open(PULSE_OUTPUT_DEV, O_RDWR)) < 0) {
printf("Open error on %s\n",PULSE_OUTPUT_DEV);
exit(0);
}
iomask=0x00;
printf("Opened on %s\n",PULSE_OUTPUT_DEV);
- while(1){
+ while (1) {
iomask^=1;
- write(fd,&iomask,sizeof(iomask));
+ write(fd, &iomask, sizeof(iomask));
usleep(TIMESLEEP);
}
close(fd);
exit(0);
}
+
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-05 10:59: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 56f57d7811f2e5784776ee15bf7a9364cba497b2 (commit)
via 1ac42b52e1d0f3be55c87076fab3c25b86e29ab9 (commit)
via 7ba8744be311508f3075435979e53274a1c57949 (commit)
via 3ff2a9cdda5ea4c1a68b8aa4feda345029708377 (commit)
via d3356eaea774182bcba129c50d0ad2c6fae20c60 (commit)
via 7cf02c7bdcd7252aa65ea492ff14899be6d2bae5 (commit)
via a2495a4e9768c99b27b1ee61814dbadf755d8696 (commit)
via ea642f08c4fe223b79bf259f9e30151be49e6fdf (commit)
from 1f2b77057bae0d441abc58ad278179cd55a38233 (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 56f57d7811f2e5784776ee15bf7a9364cba497b2
Merge: 1ac42b52e1d0f3be55c87076fab3c25b86e29ab9 1f2b77057bae0d441abc58ad278179cd55a38233
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 11:59:01 2010 +0100
Merge branch 'master' of ssh://fabm@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 1ac42b52e1d0f3be55c87076fab3c25b86e29ab9
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 11:58:10 2010 +0100
[asdevices] Adding as_max1027 in progressâ¦
commit 7ba8744be311508f3075435979e53274a1c57949
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 11:57:33 2010 +0100
[asdevices] Fix makefile bug
commit 3ff2a9cdda5ea4c1a68b8aa4feda345029708377
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 11:04:54 2010 +0100
[asdevices] Suppress apf27 reference in pwm lib
commit d3356eaea774182bcba129c50d0ad2c6fae20c60
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 10:57:27 2010 +0100
[asdevices] Testbench corrections
commit 7cf02c7bdcd7252aa65ea492ff14899be6d2bae5
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 10:37:36 2010 +0100
[asdevices] Update as_gpio library
commit a2495a4e9768c99b27b1ee61814dbadf755d8696
Author: Fabien Marteau <fab...@ar...>
Date: Fri Mar 5 10:36:53 2010 +0100
[asdevices] Update Makefile
commit ea642f08c4fe223b79bf259f9e30151be49e6fdf
Author: Fabien Marteau <fab...@ar...>
Date: Thu Mar 4 15:31:02 2010 +0100
[AsDevice] clean Makefile
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/Makefile | 18 ++-
target/packages/as_devices/c/Makefile | 17 ++-
target/packages/as_devices/c/as_apf27_gpio.h | 50 -------
.../as_devices/c/{as_apf27_gpio.c => as_gpio.c} | 97 ++++++-------
target/packages/as_devices/c/as_gpio.h | 96 ++++++++++++
target/packages/as_devices/c/as_max1027.c | 28 ++++
target/packages/as_devices/c/as_max1027.h | 68 +++++++++
.../as_devices/c/{as_apf27_pwm.c => as_pwm.c} | 22 ++--
.../as_devices/c/{as_apf27_pwm.h => as_pwm.h} | 20 ++--
target/packages/as_devices/main.c | 3 +
target/packages/as_devices/test_c.h | 154 ++++++++++++++++++--
11 files changed, 421 insertions(+), 152 deletions(-)
delete mode 100644 target/packages/as_devices/c/as_apf27_gpio.h
rename target/packages/as_devices/c/{as_apf27_gpio.c => as_gpio.c} (59%)
create mode 100644 target/packages/as_devices/c/as_gpio.h
create mode 100644 target/packages/as_devices/c/as_max1027.c
create mode 100644 target/packages/as_devices/c/as_max1027.h
rename target/packages/as_devices/c/{as_apf27_pwm.c => as_pwm.c} (93%)
rename target/packages/as_devices/c/{as_apf27_pwm.h => as_pwm.h} (69%)
diff --git a/target/packages/as_devices/Makefile b/target/packages/as_devices/Makefile
index e35e20b..b3578d4 100644
--- a/target/packages/as_devices/Makefile
+++ b/target/packages/as_devices/Makefile
@@ -1,10 +1,12 @@
-# to compile c tests
-# make CC=~/armadeus_trees/apf27/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gcc test_cdevices
-# to compile cpp tests
-# make CC=~/armadeus_trees/apf27/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gcc CXX=~/armadeus_trees/apf27/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-g++ test_cppdevices
-#
+# Default values for local compiling:
+ARMADEUS_BASE_DIR=../../../
+include $(ARMADEUS_BASE_DIR)/Makefile.in
+
CFLAGS=-Wall -g -O0
LDFLAGS=
+CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+CXX:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
+STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
C_BINARY=test_cdevices
C_LIBNAME=as_devices
@@ -31,9 +33,9 @@ ${C_BINARY}: main.c test_c.h ${C_LIB}
# cd cpp; make CXX=${CXX}
${C_LIB}:
- cd c; make CC=${CC}
+ cd c; make
clean:
- cd c; make clean ; cd ../cpp; make clean; cd ../python; make clean
- -rm ${C_BINARY} ${CPP_BINARY}
+ cd c; make clean ; #cd ../cpp; make clean; cd ../python; make clean
+ -rm ${C_BINARY} # ${CPP_BINARY}
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index e2fcea2..816efe6 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -1,16 +1,19 @@
-# to compile for arm :
-# make CC=../../bsp/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gcc
-# make CC=~/Projects/HMSDemo/software/bsp/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gcc
-# make CC=~/Projects/virgin_HMS/software/bsp/buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gcc
-#
+# Default values for local compiling:
+#
+ARMADEUS_BASE_DIR=../../../../
+include $(ARMADEUS_BASE_DIR)/Makefile.in
+
CFLAGS=-Wall -g -O0
LDFLAGS=
+CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
-OBJ=as_apf27_pwm.o
+OBJ=as_pwm.o
OBJ+= as_i2c.o
-OBJ+= as_apf27_gpio.o
+OBJ+= as_gpio.o
OBJ+= as_93lcxx.o
OBJ+= as_spi.o
+OBJ+= as_max1027.o
LIBRARY=as_devices
LIB_VERS=1
diff --git a/target/packages/as_devices/c/as_apf27_gpio.h b/target/packages/as_devices/c/as_apf27_gpio.h
deleted file mode 100644
index 040a563..0000000
--- a/target/packages/as_devices/c/as_apf27_gpio.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-** THE ARMadeus Systems
-**
-** Copyright (C) 2009 The armadeus systems team
-** Fabien Marteau <fab...@ar...>
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library 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
-** Lesser General Public License for more details.
-**
-** 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
-*/
-
-#ifndef __ASAPF27GPIO_H__
-#define __ASAPF27GPIO_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#define NUMBER_OF_PORTS 6
-
-int as_apf27_gpio_init(char aPortChar);
-
-int as_apf27_gpio_set_pin_direction(char aPortChar,
- int aPinNum,
- int aDirection);
-
-int as_apf27_gpio_set_pin_value(char aPortChar,
- int aPinNum,
- int aValue);
-
-int as_apf27_gpio_get_pin_value(char aPortChar,
- int aPinNum);
-
-int as_apf27_gpio_close(char aPortChar);
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // __ASAPF27GPIO_H__
diff --git a/target/packages/as_devices/c/as_apf27_gpio.c b/target/packages/as_devices/c/as_gpio.c
similarity index 59%
rename from target/packages/as_devices/c/as_apf27_gpio.c
rename to target/packages/as_devices/c/as_gpio.c
index 20b55b2..bf8422b 100644
--- a/target/packages/as_devices/c/as_apf27_gpio.c
+++ b/target/packages/as_devices/c/as_gpio.c
@@ -19,7 +19,7 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "as_apf27_gpio.h"
+#include "as_gpio.h"
#include <stdlib.h>
#include <stdio.h>
@@ -39,67 +39,68 @@
#define GPIO_BASE_PORT ("/dev/gpio/port")
-static int mFileHandlerGpioPort[NUMBER_OF_PORTS];
-
/*------------------------------------------------------------------------------*/
-/** Initialize port access
- * @param aPortChar character port in UPPER case
- * @return error if negative value
- */
-int
-as_apf27_gpio_init(char aPortChar)
+struct as_gpio_device *
+as_gpio_open(char aPortChar)
{
+ struct as_gpio_device *dev;
char gpio_file_path[50];
int ret=0;
+ if (((aPortChar-'A') > (NUMBER_OF_PORTS-1)) || ((aPortChar-'A') < 0))
+ {
+ return NULL;
+ }
+
/* make gpio port string path */
ret = snprintf(gpio_file_path,50, "%s%c",
GPIO_BASE_PORT, aPortChar);
if (ret < 0) {
- return ret;
+ return NULL;
}
/* opening gpio port */
- mFileHandlerGpioPort[aPortChar-'A'] = open(gpio_file_path, O_RDWR);
- if (mFileHandlerGpioPort[aPortChar-'A'] < 0) {
- return mFileHandlerGpioPort[aPortChar-'A'];
+ ret = open(gpio_file_path, O_RDWR);
+ if (ret < 0) {
+ return NULL;
}
- return 0;
+ dev = (struct as_gpio_device *)malloc(sizeof(struct as_gpio_device));
+ if (dev == NULL)
+ return NULL;
+
+ dev->port_letter = aPortChar;
+ dev->fdev = ret;
+
+ return dev;
}
/*------------------------------------------------------------------------------*/
-/** Set pin direction
- * @param aPortChar port character in upper case
- * @param aPinNum pin number
- * @param aDirection direction 0:input 1:output
- * @return error if negative value
- */
-int
-as_apf27_gpio_set_pin_direction(char aPortChar,
- int aPinNum,
- int aDirection)
+int32_t
+as_gpio_set_pin_direction(struct as_gpio_device *dev,
+ int aPinNum,
+ int aDirection)
{
int ret=0;
int portval;
/* Set LED PIN as GPIO; read/modify/write */
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIORDMODE, &portval);
+ ret = ioctl(dev->fdev, GPIORDMODE, &portval);
if (ret < 0) {
return ret;
}
portval |= (1 << aPinNum);
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIOWRMODE, &portval);
+ ret = ioctl(dev->fdev, GPIOWRMODE, &portval);
if (ret < 0) {
return ret;
}
/* set direction */
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIORDDIRECTION, &portval);
+ ret = ioctl(dev->fdev, GPIORDDIRECTION, &portval);
if (ret < 0) {
return ret;
}
@@ -110,7 +111,7 @@ as_apf27_gpio_set_pin_direction(char aPortChar,
portval |= (1 << aPinNum);
}
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIOWRDIRECTION, &portval);
+ ret = ioctl(dev->fdev, GPIOWRDIRECTION, &portval);
if (ret < 0) {
return ret;
}
@@ -119,21 +120,15 @@ as_apf27_gpio_set_pin_direction(char aPortChar,
/*------------------------------------------------------------------------------*/
-/** Set pin value
- * @param aPortChar port character in upper case
- * @param aPinNum pin number
- * @param aValue value of pin (1 or 0)
- * @return error if negative
- */
-int
-as_apf27_gpio_set_pin_value(char aPortChar,
- int aPinNum,
- int aValue)
+int32_t
+as_gpio_set_pin_value( struct as_gpio_device *dev,
+ int aPinNum,
+ int aValue)
{
int ret=0;
int portval;
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIORDDATA, &portval);
+ ret = ioctl(dev->fdev, GPIORDDATA, &portval);
if (ret < 0) {
return ret;
}
@@ -143,7 +138,7 @@ as_apf27_gpio_set_pin_value(char aPortChar,
} else {
portval |= (1 << aPinNum);
}
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIOWRDATA, &portval);
+ ret = ioctl(dev->fdev, GPIOWRDATA, &portval);
if (ret < 0) {
return ret;
}
@@ -153,18 +148,13 @@ as_apf27_gpio_set_pin_value(char aPortChar,
/*------------------------------------------------------------------------------*/
-/** Get pin value
- * @param aPortChar port character in upper case
- * @param aPinNum pin number
- * @return pin value if positive or null, error if negative
- */
-int as_apf27_gpio_get_pin_value(char aPortChar,
+int32_t as_gpio_get_pin_value( struct as_gpio_device *dev,
int aPinNum)
{
int ret=0;
int portval;
- ret = ioctl(mFileHandlerGpioPort[aPortChar-'A'], GPIORDDATA, &portval);
+ ret = ioctl(dev->fdev, GPIORDDATA, &portval);
if (ret < 0) {
return ret;
}
@@ -178,13 +168,12 @@ int as_apf27_gpio_get_pin_value(char aPortChar,
/*------------------------------------------------------------------------------*/
-/** Close port access
- * @param aPortChar port character in upper case
- * @return pin value if positive or null, error if negative
- */
-int
-as_apf27_gpio_close(char aPortChar)
+int32_t
+as_gpio_close(struct as_gpio_device *dev)
{
- return close(mFileHandlerGpioPort[aPortChar-'A']);
+ int ret;
+ ret = close(dev->fdev);
+ free(dev);
+ return 0;
}
diff --git a/target/packages/as_devices/c/as_gpio.h b/target/packages/as_devices/c/as_gpio.h
new file mode 100644
index 0000000..3ed3b9e
--- /dev/null
+++ b/target/packages/as_devices/c/as_gpio.h
@@ -0,0 +1,96 @@
+/*
+** THE ARMadeus Systems
+**
+** Copyright (C) 2009 The armadeus systems team
+** Fabien Marteau <fab...@ar...>
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library 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
+** Lesser General Public License for more details.
+**
+** 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
+*/
+
+#ifndef __ASGPIO_H__
+#define __ASGPIO_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#define NUMBER_OF_PORTS 6
+
+/**
+ * Store gpio parameters
+ */
+struct as_gpio_device {
+ unsigned char port_letter;
+ int fdev;
+};
+
+/** @brief Initialize port access
+ *
+ * @param aPortChar character port in UPPER case
+ *
+ * @return error if negative value
+ */
+struct as_gpio_device *as_gpio_open(char aPortChar);
+
+/** @brief Set pin direction
+ *
+ * @param aPortChar port character in upper case
+ * @param aPinNum pin number
+ * @param aDirection direction 0:input 1:output
+ *
+ * @return error if negative value
+ */
+int32_t as_gpio_set_pin_direction( struct as_gpio_device *dev,
+ int aPinNum,
+ int aDirection);
+
+/** @brief Set pin value
+ *
+ * @param aPortChar port character in upper case
+ * @param aPinNum pin number
+ * @param aValue value of pin (1 or 0)
+ *
+ * @return error if negative
+ */
+int32_t as_gpio_set_pin_value( struct as_gpio_device *dev,
+ int aPinNum,
+ int aValue);
+
+/** @brief Get pin value
+ *
+ * @param aPortChar port character in upper case
+ * @param aPinNum pin number
+ *
+ * @return pin value if positive or null, error if negative
+ */
+int32_t as_gpio_get_pin_value( struct as_gpio_device *dev,
+ int aPinNum);
+
+/** @brief Close port access
+ *
+ * @param aPortChar port character in upper case
+ *
+ * @return pin value if positive or null, error if negative
+ */
+
+int32_t as_gpio_close( struct as_gpio_device *dev);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // __ASGPIO_H__
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
new file mode 100644
index 0000000..b243188
--- /dev/null
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -0,0 +1,28 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * 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
+ *
+ *
+ * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "as_max1027.h"
+
+
+
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
new file mode 100644
index 0000000..524f060
--- /dev/null
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -0,0 +1,68 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * 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
+ *
+ *
+ * Copyright (C) 2010 Fabien Marteau <fab...@ar...>
+ *
+ */
+
+#ifndef AS_MAX1027_H_
+#define AS_MAX1027_H_
+
+/** @file
+ * @brief Read/Write analog value with max1027 chip
+ *
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ AS_MAX1027_FAST,
+ AS_MAX1027_SLOW
+} AS_max1027_mode;
+
+/**
+ * Store max1027 parameters
+ */
+struct as_max1027_device {
+ AS_max1027_mode mode;
+};
+
+
+/** @brief Open max1027
+ *
+ * @param aSpiNum spi bus number used
+ *
+ * @return as_max1027_device structure pointer, NULL if error
+ */
+struct as_max1027_device *as_max1027_open(int aSpiNum,
+ AS_max1027_mode mode);
+
+//setAveraging();
+//readTemperature_mC();
+//readTemperature_C();
+//
+//getValueInMilliVolt();
+//getValueInVolt();
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* AS_MAX1027_H_ */
diff --git a/target/packages/as_devices/c/as_apf27_pwm.c b/target/packages/as_devices/c/as_pwm.c
similarity index 93%
rename from target/packages/as_devices/c/as_apf27_pwm.c
rename to target/packages/as_devices/c/as_pwm.c
index 3db3de4..1fa4e2d 100644
--- a/target/packages/as_devices/c/as_apf27_pwm.c
+++ b/target/packages/as_devices/c/as_pwm.c
@@ -25,7 +25,7 @@
#include <errno.h> /* for perror() */
#include <unistd.h> /* for write() */
-#include "as_apf27_pwm.h"
+#include "as_pwm.h"
#define PWM_SYS_PATH "/sys/class/pwm/pwm"
#define FREQUENCY_PATH "frequency"
@@ -76,7 +76,7 @@ writeBuffer(int aFile_handler, char *aValueWrite)
* @return error code
*/
int
-as_apf27_pwm_init(int aPwmNumber)
+as_pwm_init(int aPwmNumber)
{
char buffer[50];
@@ -118,7 +118,7 @@ as_apf27_pwm_init(int aPwmNumber)
* @return no error if positive value
*/
int
-as_apf27_pwm_close(int aPwmNumber)
+as_pwm_close(int aPwmNumber)
{
int ret = 0;
@@ -161,7 +161,7 @@ as_apf27_pwm_close(int aPwmNumber)
* @return no error if positive value
*/
int
-as_apf27_pwm_setFrequency(int aPwmNumber, int aFrequency)
+as_pwm_setFrequency(int aPwmNumber, int aFrequency)
{
char buffer[50];
@@ -176,7 +176,7 @@ as_apf27_pwm_setFrequency(int aPwmNumber, int aFrequency)
* @return int frequency in Hz
*/
int
-as_apf27_pwm_getFrequency(int aPwmNumber)
+as_pwm_getFrequency(int aPwmNumber)
{
return mFrequency[aPwmNumber];
}
@@ -189,7 +189,7 @@ as_apf27_pwm_getFrequency(int aPwmNumber)
* @return positive value if no error
*/
int
-as_apf27_pwm_setPeriod(int aPwmNumber, int aPeriod)
+as_pwm_setPeriod(int aPwmNumber, int aPeriod)
{
char buffer[50];
mPeriod[aPwmNumber] = aPeriod;
@@ -203,7 +203,7 @@ as_apf27_pwm_setPeriod(int aPwmNumber, int aPeriod)
* @return period int in us
*/
int
-as_apf27_pwm_getPeriod(int aPwmNumber)
+as_pwm_getPeriod(int aPwmNumber)
{
return mPeriod[aPwmNumber];
}
@@ -215,7 +215,7 @@ as_apf27_pwm_getPeriod(int aPwmNumber)
* @return positive value if no error
*/
int
-as_apf27_pwm_setDuty(int aPwmNumber, int aDuty)
+as_pwm_setDuty(int aPwmNumber, int aDuty)
{
char buffer[50];
mDuty[aPwmNumber] = aDuty;
@@ -230,7 +230,7 @@ as_apf27_pwm_setDuty(int aPwmNumber, int aDuty)
* @return duty
*/
int
-as_apf27_pwm_getDuty(int aPwmNumber)
+as_pwm_getDuty(int aPwmNumber)
{
return mDuty[aPwmNumber];
}
@@ -240,7 +240,7 @@ as_apf27_pwm_getDuty(int aPwmNumber)
* @param aPwmNumber pwm number used
* @param aEnable
*/
-int as_apf27_pwm_activate(int aPwmNumber, int aEnable)
+int as_pwm_activate(int aPwmNumber, int aEnable)
{
char one[] = "1";
char zero[] = "0";
@@ -261,7 +261,7 @@ int as_apf27_pwm_activate(int aPwmNumber, int aEnable)
}
-int as_apf27_pwm_getState(int aPwmNumber)
+int as_pwm_getState(int aPwmNumber)
{
//XXX: get real state in pwm driver instead global variable
return mState[aPwmNumber];
diff --git a/target/packages/as_devices/c/as_apf27_pwm.h b/target/packages/as_devices/c/as_pwm.h
similarity index 69%
rename from target/packages/as_devices/c/as_apf27_pwm.h
rename to target/packages/as_devices/c/as_pwm.h
index 4359958..769fa2b 100644
--- a/target/packages/as_devices/c/as_apf27_pwm.h
+++ b/target/packages/as_devices/c/as_pwm.h
@@ -29,21 +29,21 @@ extern "C" {
/* number of pwm under system */
#define NUMBER_OF_PWM 2
-int as_apf27_pwm_init(int aPwmNumber);
+int as_pwm_init(int aPwmNumber);
-int as_apf27_pwm_setFrequency(int aPwmNumber, int aFrequency);
-int as_apf27_pwm_getFrequency(int aPwmNumber);
+int as_pwm_setFrequency(int aPwmNumber, int aFrequency);
+int as_pwm_getFrequency(int aPwmNumber);
-int as_apf27_pwm_setPeriod(int aPwmNumber, int aPeriod);
-int as_apf27_pwm_getPeriod(int aPwmNumber);
+int as_pwm_setPeriod(int aPwmNumber, int aPeriod);
+int as_pwm_getPeriod(int aPwmNumber);
-int as_apf27_pwm_setDuty(int aPwmNumber, int aDuty);
-int as_apf27_pwm_getDuty(int aPwmNumber);
+int as_pwm_setDuty(int aPwmNumber, int aDuty);
+int as_pwm_getDuty(int aPwmNumber);
-int as_apf27_pwm_activate(int aPwmNumber, int aEnable);
-int as_apf27_pwm_getState(int aPwmNumber);
+int as_pwm_activate(int aPwmNumber, int aEnable);
+int as_pwm_getState(int aPwmNumber);
-int as_apf27_pwm_close(int aPwmNumber);
+int as_pwm_close(int aPwmNumber);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/main.c b/target/packages/as_devices/main.c
index bcb0521..e74c9b9 100644
--- a/target/packages/as_devices/main.c
+++ b/target/packages/as_devices/main.c
@@ -41,6 +41,7 @@ int main(int argc, char ** argv)
printf(" 2) Testing i2c\n");
printf(" 3) Testing spi\n");
printf(" 4) Testing 93LCxx eprom\n");
+ printf(" 5) Testing gpio\n");
printf("> ");
scanf("%s",buffer);
@@ -54,6 +55,8 @@ int main(int argc, char ** argv)
break;
case '4' : test_93LC();
break;
+ case '5' : test_gpio();
+ break;
default : break;
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index 9d18f9f..54be388 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -23,9 +23,10 @@
#include <stdlib.h>
#include <math.h>
-#include "as_apf27_pwm.h"
+#include "as_pwm.h"
#include "as_93lcxx.h"
#include "as_i2c.h"
+#include "as_gpio.h"
#define PWM_NUM 0
@@ -44,7 +45,7 @@ void test_pwm(void)
char buffer2[20];
int value;
- ret = as_apf27_pwm_init(PWM_NUM);
+ ret = as_pwm_init(PWM_NUM);
if(ret < 0){
printf("can't init pwm0\n");
return;
@@ -71,41 +72,41 @@ void test_pwm(void)
{
case '1' : printf("Give frequency :");
scanf("%d",&value);
- as_apf27_pwm_setFrequency(PWM_NUM,value);
+ as_pwm_setFrequency(PWM_NUM,value);
pressEnterToContinue();
break;
case '2' : printf("Current pwm frequency is %d\n",
- as_apf27_pwm_getFrequency(PWM_NUM));
+ as_pwm_getFrequency(PWM_NUM));
pressEnterToContinue();
break;
case '3' : printf("Give period :");
scanf("%d",&value);
- as_apf27_pwm_setPeriod(PWM_NUM,value);
+ as_pwm_setPeriod(PWM_NUM,value);
pressEnterToContinue();
break;
case '4' : printf("Current period is %d\n",
- as_apf27_pwm_getPeriod(PWM_NUM));
+ as_pwm_getPeriod(PWM_NUM));
pressEnterToContinue();
break;
case '5' : printf("Give Duty :");
scanf("%d",&value);
- as_apf27_pwm_setDuty(PWM_NUM,value);
+ as_pwm_setDuty(PWM_NUM,value);
pressEnterToContinue();
break;
case '6' : printf("Current Duty is %d\n",
- as_apf27_pwm_getDuty(PWM_NUM));
+ as_pwm_getDuty(PWM_NUM));
pressEnterToContinue();
break;
case '7' : printf("Activate 'a' or Desactivate 'd' ?");
scanf("%s",buffer2);
if(buffer2[0] == 'a')
{
- as_apf27_pwm_activate(PWM_NUM,1);
+ as_pwm_activate(PWM_NUM,1);
printf("Pwm activated\n");
pressEnterToContinue();
}else if(buffer2[0] == 'd')
{
- as_apf27_pwm_activate(PWM_NUM,0);
+ as_pwm_activate(PWM_NUM,0);
printf("Pwm desactivated\n");
pressEnterToContinue();
}else{
@@ -113,7 +114,7 @@ void test_pwm(void)
pressEnterToContinue();
}
break;
- case '8' : if(as_apf27_pwm_getState(PWM_NUM))
+ case '8' : if(as_pwm_getState(PWM_NUM))
{
printf("pwm is active\n");
pressEnterToContinue();
@@ -125,7 +126,7 @@ void test_pwm(void)
default : break;
}
}
- ret = as_apf27_pwm_close(PWM_NUM);
+ ret = as_pwm_close(PWM_NUM);
if(ret < 0){
printf("can't close pwm0\n");
return;
@@ -423,3 +424,132 @@ void test_93LC()
}
}
}
+
+void test_gpio()
+{
+ char buffer[50];
+ struct as_gpio_device *gpio_dev;
+ int32_t ret;
+ char c_value;
+ int32_t value;
+ char port_letter = 'F';
+ int port_num = 14;
+ int port_direction = 0;
+ int port_value = 1;
+
+ gpio_dev = as_gpio_open(port_letter);
+ if (gpio_dev == NULL)
+ {
+ printf("Error can't open gpio %c\nHave you run loadgpio.sh ?\n", port_letter);
+ pressEnterToContinue();
+ return ;
+ }
+ ret = as_gpio_get_pin_value(gpio_dev,
+ port_num);
+ if (ret < 0)
+ {
+ printf("Error, can't get pin value\n");
+ return;
+ }
+ port_value = ret;
+
+
+ while(buffer[0] != 'q')
+ {
+ system("clear");
+ printf("**************************\n");
+ printf(" Testing GPIO P%c%d \n", port_letter, port_num);
+ printf("**************************\n");
+ printf("Choose ('q' to quit):\n");
+ printf(" 1) Change port letter (%c)\n", port_letter);
+ printf(" 2) Change port num (%d)\n", port_num);
+ printf(" 3) Change direction (%d)\n", port_direction);
+ printf(" 4) Change value (%d)\n", port_value);
+ printf(" 5) Read pin value\n");
+
+ printf("> ");
+ scanf("%s",buffer);
+
+ switch(buffer[0])
+ {
+ case '1' : printf("Give letter of port in upper case : ");
+ scanf("%s", buffer);
+ if (buffer[0] != port_letter)
+ {
+ ret = as_gpio_close(gpio_dev);
+ if(ret < 0)
+ {
+ printf("Error, can't close Port%c\n", port_letter);
+ pressEnterToContinue();
+ return ;
+ }
+ }
+ gpio_dev = as_gpio_open(buffer[0]);
+ if(gpio_dev == NULL)
+ {
+ printf("Error, can't open Port%c\n", c_value);
+ pressEnterToContinue();
+ return;
+ }
+ port_letter = buffer[0];
+ printf("Ok Port %c is set\n", port_letter);
+ pressEnterToContinue();
+ break;
+ case '2' : printf("Give pin number : ");
+ scanf("%d", &value);
+ if ((value < 0) || (value > 31))
+ printf("Error, wrong value\n");
+ else
+ port_num = value;
+ pressEnterToContinue();
+ break;
+ case '3' : printf("Give direction (0:in, 1:out) : ");
+ scanf("%d", &value);
+ ret = as_gpio_set_pin_direction(gpio_dev,
+ port_num,
+ value);
+ if(ret < 0)
+ {
+ printf("Error, can't change direction\n");
+ pressEnterToContinue();
+ return ;
+ }
+ port_direction = value;
+ printf("Ok direction changed\n");
+ pressEnterToContinue();
+ break;
+ case '4' : printf("Give value : ");
+ scanf("%d", &value);
+ ret = as_gpio_set_pin_value(gpio_dev,
+ port_num,
+ value);
+ if(ret < 0)
+ {
+ printf("Error, can't change pin value\n");
+ pressEnterToContinue();
+ return;
+ }
+ port_value = value;
+ printf("Ok value changed\n");
+ pressEnterToContinue();
+ break;
+ case '5' : printf("Get value \n");
+ ret = as_gpio_get_pin_value(gpio_dev,
+ port_num);
+ if (ret < 0)
+ {
+ printf("Error, can't get pin value\n");
+ pressEnterToContinue();
+ return;
+ }
+ printf("Value is %d\n",ret);
+ port_value = ret;
+ pressEnterToContinue();
+ break;
+
+ default : break;
+ }
+ }
+}
+
+
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-04 12:52: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 1f2b77057bae0d441abc58ad278179cd55a38233 (commit)
from d2e82eb0947ad80aa4466ebdb1547142ea5ace60 (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 1f2b77057bae0d441abc58ad278179cd55a38233
Author: Fabien Marteau <fab...@ar...>
Date: Thu Mar 4 13:50:45 2010 +0100
[linux] update apf9328 linux config file
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf9328/apf9328-linux-2.6.29.config | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config b/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config
index 58967f6..047fb13 100644
--- a/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config
+++ b/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config
@@ -912,10 +912,8 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=m
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI9320 is not set
-# CONFIG_LCD_HX5116 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
-# CONFIG_LCD_P0340WQL is not set
# CONFIG_LCD_PLATFORM is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
@@ -1225,6 +1223,7 @@ CONFIG_ARMADEUS_PS2KBD_DRIVER=m
#
CONFIG_ARMADEUS_PWM_DRIVER=m
CONFIG_IMX_BACKLIGHT=m
+# CONFIG_HX5116_DISPLAY is not set
#
# Communication bus related
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2010-03-04 11:25: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 d2e82eb0947ad80aa4466ebdb1547142ea5ace60 (commit)
from dadf051cba0817009148bbf2fe67bbcef35273cd (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 d2e82eb0947ad80aa4466ebdb1547142ea5ace60
Author: Fabien Marteau <fab...@ar...>
Date: Thu Mar 4 12:25:16 2010 +0100
[BUILDROOT] Default apf9328 configuration file correction
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf9328/apf9328_defconfig | 32 ++++++++------------
1 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf9328/apf9328_defconfig b/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
index 29eec07..52783a4 100644
--- a/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
+++ b/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
@@ -324,22 +324,29 @@ BR2_PACKAGE_PKGCONFIG=y
#
# Armadeus specific packages
#
+# BR2_PACKAGE_UUCP is not set
# BR2_PACKAGE_LIBDNET is not set
#
# bluez not available (need dbus)
#
# BR2_PACKAGE_MESALIB is not set
-# BR2_PACKAGE_FBTEST is not set
-# BR2_PACKAGE_IMXSSI is not set
-# BR2_PACKAGE_DUMMY is not set
-# BR2_PACKAGE_SNES9X is not set
-# BR2_PACKAGE_AS_DEVICES is not set
#
# Armadeus specific tools/utilities
#
+# BR2_PACKAGE_AD9889CTRL is not set
+# BR2_PACKAGE_AS_DEVICES is not set
+BR2_PACKAGE_CH7024CTRL=y
# BR2_PACKAGE_ARMADEUS_DEMOS is not set
+BR2_PACKAGE_FPGAREGS=y
+BR2_PACKAGE_IMXREGS=y
+# BR2_PACKAGE_IMXSSI is not set
+BR2_PACKAGE_MAX5821CTRL=y
+# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+# BR2_PACKAGE_DUMMY is not set
+# BR2_PACKAGE_FBTEST is not set
+# BR2_PACKAGE_SNES9X is not set
#
# Other stuff
@@ -476,9 +483,6 @@ BR2_PACKAGE_PORTMAP=y
# BR2_PACKAGE_WEBIF is not set
# BR2_PACKAGE_WIRELESS_TOOLS is not set
BR2_BLOCKDEV_SUPPORT=y
-# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
-# BR2_PACKAGE_AD9889CTRL is not set
-BR2_PACKAGE_CH7024CTRL=y
#
# dbus not available (need expat or libxml2)
@@ -490,7 +494,6 @@ BR2_PACKAGE_CH7024CTRL=y
# BR2_PACKAGE_EEPROG is not set
# BR2_PACKAGE_FCONFIG is not set
# BR2_PACKAGE_FIS is not set
-BR2_PACKAGE_FPGAREGS=y
# BR2_PACKAGE_LIBFUSE is not set
# BR2_PACKAGE_GADGETFS_TEST is not set
# BR2_PACKAGE_GPM is not set
@@ -498,7 +501,6 @@ BR2_PACKAGE_FPGAREGS=y
# BR2_PACKAGE_HWDATA is not set
# BR2_PACKAGE_I2C_TOOLS is not set
# BR2_PACKAGE_INPUT_TOOLS is not set
-BR2_PACKAGE_IMXREGS=y
# BR2_PACKAGE_IOSTAT is not set
# BR2_PACKAGE_LCD4LINUX is not set
# BR2_PACKAGE_LIBAIO is not set
@@ -506,7 +508,6 @@ BR2_PACKAGE_IMXREGS=y
# BR2_PACKAGE_LIBUSB is not set
# BR2_PACKAGE_LM_SENSORS is not set
# BR2_PACKAGE_LVM2 is not set
-BR2_PACKAGE_MAX5821CTRL=y
# BR2_PACKAGE_MDADM is not set
# BR2_PACKAGE_MEMTESTER is not set
# BR2_PACKAGE_MKDOSFS is not set
@@ -532,7 +533,6 @@ BR2_PACKAGE_MTD_FLASH_UNLOCK=y
# BR2_PACKAGE_MTD_FTL_FORMAT is not set
BR2_PACKAGE_MTD_JFFS2DUMP=y
BR2_PACKAGE_MTD_MKFSJFFS2=y
-# BR2_PACKAGE_MTD_MKFSJFFS is not set
BR2_PACKAGE_MTD_MTD_DEBUG=y
BR2_PACKAGE_MTD_NANDDUMP=y
BR2_PACKAGE_MTD_NANDTEST=y
@@ -596,6 +596,7 @@ BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y
BR2_PACKAGE_MPG123_ALSA=y
# BR2_PACKAGE_SPEEX is not set
# BR2_PACKAGE_FESTIVAL is not set
+# BR2_PACKAGE_FLITE is not set
BR2_GRAPHIC_SUPPORT=y
#
@@ -750,13 +751,6 @@ BR2_TARGET_ROOTFS_JFFS2_LE=y
BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2"
BR2_TARGET_ROOTFS_JFFS2_COPYTO=""
# BR2_TARGET_ROOTFS_UBIFS is not set
-# BR2_TARGET_ROOTFS_UBIFS_RT_NONE is not set
-# BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB is not set
-# BR2_TARGET_ROOTFS_UBIFS_RT_LZO is not set
-# BR2_TARGET_ROOTFS_UBIFS_NONE is not set
-# BR2_TARGET_ROOTFS_UBIFS_GZIP is not set
-# BR2_TARGET_ROOTFS_UBIFS_BZIP2 is not set
-# BR2_TARGET_ROOTFS_UBIFS_LZMA is not set
# BR2_TARGET_ROOTFS_SQUASHFS is not set
BR2_TARGET_ROOTFS_TAR=y
BR2_TARGET_ROOTFS_TAR_NONE=y
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-03-03 14:31:11
|
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 dadf051cba0817009148bbf2fe67bbcef35273cd (commit)
from 655e0d5908ffd7782105cde03a72b601724038de (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 dadf051cba0817009148bbf2fe67bbcef35273cd
Author: Julien Boibessot <jul...@ar...>
Date: Wed Mar 3 15:26:33 2010 +0100
Indentation
-----------------------------------------------------------------------
Summary of changes:
.../modules/fpga/wishbone_example/wb_led/g_led.c | 82 ++++++++++---------
.../modules/fpga/wishbone_example/wb_led/led.h | 18 ++---
2 files changed, 50 insertions(+), 50 deletions(-)
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 3accb90..0bbdfd4 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
@@ -109,25 +109,27 @@ struct file_operations led_fops = {
* characters file /dev operations
* *********************************/
ssize_t led_read(struct file *fildes, char __user *buff,
- size_t count, loff_t *offp){
+ size_t count, loff_t *offp)
+{
struct led_dev *sdev = fildes->private_data;
u16 data=0;
+
PDEBUG("Read value\n");
- if(*offp != 0 ){ /* offset must be 0 */
- PDEBUG("offset %d\n",(int)*offp);
+ if (*offp != 0) { /* offset must be 0 */
+ PDEBUG("offset %d\n", (int)*offp);
return 0;
}
PDEBUG("count %d\n",count);
- if(count > 2){ /* 16bits max*/
+ 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));
+ PDEBUG("Read %d at %x\n", data, (int)(sdev->membase+LED_REG_OFFSET));
/* return data for user */
- if(copy_to_user(buff,&data,count)){
+ if (copy_to_user(buff, &data, count)) {
printk(KERN_WARNING "read : copy to user data error\n");
return -EFAULT;
}
@@ -135,21 +137,22 @@ ssize_t led_read(struct file *fildes, char __user *buff,
}
ssize_t led_write(struct file *fildes, const char __user *
- buff,size_t count, loff_t *offp){
+ buff,size_t count, loff_t *offp)
+{
struct led_dev *sdev = fildes->private_data;
- u16 data=0;
+ u16 data = 0;
- if(*offp != 0){ /* offset must be 0 */
- PDEBUG("offset %d\n",(int)*offp);
+ if (*offp != 0) { /* offset must be 0 */
+ PDEBUG("offset %d\n", (int)*offp);
return 0;
}
- PDEBUG("count %d\n",count);
- if(count > 2){ /* 16 bits max)*/
+ PDEBUG("count %d\n", count);
+ if (count > 2) { /* 16 bits max)*/
count = 2;
}
- if(copy_from_user(&data,buff,count)){
+ if (copy_from_user(&data, buff, count)) {
printk(KERN_WARNING "write : copy from user error\n");
return -EFAULT;
}
@@ -157,15 +160,16 @@ ssize_t led_write(struct file *fildes, const char __user *
PDEBUG("Write %d at %x\n",
data,
(int)(sdev->membase+LED_REG_OFFSET));
- iowrite16(data,sdev->membase+LED_REG_OFFSET);
+ iowrite16(data, sdev->membase+LED_REG_OFFSET);
return count;
}
-int led_open(struct inode *inode, struct file *filp){
+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");
+ filp->private_data = container_of(inode->i_cdev, struct led_dev, cdev);
+ PDEBUG("Led opened\n");
return 0;
}
@@ -176,8 +180,8 @@ 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);
+ dev = container_of(inode->i_cdev, struct led_dev, cdev);
+ PDEBUG("%s: released\n", dev->name);
filp->private_data=NULL;
return 0;
@@ -189,32 +193,31 @@ int led_release(struct inode *inode, struct file *filp)
static int led_probe(struct platform_device *pdev)
{
struct plat_led_port *dev = pdev->dev.platform_data;
-
int result = 0; /* error return */
- int led_major,led_minor;
+ int led_major, led_minor;
u16 data;
struct led_dev *sdev;
PDEBUG("Led probing\n");
- PDEBUG("Register %s num %d\n",dev->name,dev->num);
+ PDEBUG("Register %s num %d\n", dev->name, dev->num);
/**************************/
/* check if ID is correct */
/**************************/
data = ioread16(dev->membase+dev->idoffset);
- if(data != dev->idnum){
+ 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);
+ dev->name, dev->idnum, data);
goto error_id;
}
/********************************************/
/* allocate memory for sdev structure */
/********************************************/
- sdev = kmalloc(sizeof(struct led_dev),GFP_KERNEL);
- if(!sdev){
+ sdev = kmalloc(sizeof(struct led_dev), GFP_KERNEL);
+ if (!sdev) {
result = -ENOMEM;
goto error_sdev_alloc;
}
@@ -226,7 +229,7 @@ static int led_probe(struct platform_device *pdev)
printk("Kmalloc name space error\n");
goto error_name_alloc;
}
- if (strncpy(sdev->name,dev->name,1+strlen(dev->name)) < 0) {
+ if (strncpy(sdev->name, dev->name, 1+strlen(dev->name)) < 0) {
printk("copy error");
goto error_name_copy;
}
@@ -239,9 +242,9 @@ static int led_probe(struct platform_device *pdev)
led_minor = dev->num ;/* num come from plat_led_port data structure */
sdev->devno = MKDEV(led_major, led_minor);
- result = alloc_chrdev_region(&(sdev->devno),led_minor, 1,dev->name);
+ 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);
+ printk(KERN_WARNING "%s: can't get major %d\n", dev->name, led_major);
goto error_devno;
}
printk(KERN_INFO "%s: MAJOR: %d MINOR: %d\n",
@@ -267,9 +270,9 @@ static int led_probe(struct platform_device *pdev)
}
/* initialize led value */
- data=1;
- iowrite16(data,sdev->membase);
- PDEBUG("Wrote %x at %x\n", data,(int)( sdev->membase+LED_REG_OFFSET));
+ data = 1;
+ iowrite16(data, sdev->membase);
+ PDEBUG("Wrote %x at %x\n", data, (int)(sdev->membase+LED_REG_OFFSET));
/* OK module inserted ! */
printk(KERN_INFO "Led module %s insered\n", dev->name);
@@ -280,11 +283,11 @@ static int led_probe(struct platform_device *pdev)
/*********************/
/* delete the cdev structure */
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n",dev->name);
+ 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);
+ unregister_chrdev_region(sdev->devno, 1);
+ printk(KERN_INFO "%s: Led deleted\n", dev->name);
error_devno:
error_name_copy:
kfree(sdev->name);
@@ -300,14 +303,15 @@ 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);
+
+ PDEBUG("Unregister %s, number %d\n", dev->name, dev->num);
/* delete the cdev structure */
- PDEBUG("cdev name : %s\n",sdev->name);
+ PDEBUG("cdev name : %s\n", sdev->name);
cdev_del(&sdev->cdev);
- PDEBUG("%s:cdev deleted\n",dev->name);
+ PDEBUG("%s:cdev deleted\n", dev->name);
/*error_cdev_add:*/
/* free major and minor number */
- unregister_chrdev_region(sdev->devno,1);
+ unregister_chrdev_region(sdev->devno, 1);
/*error_devno:*/
/*error_name_copy:*/
kfree(sdev->name);
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 29682c4..97674c3 100644
--- a/target/linux/modules/fpga/wishbone_example/wb_led/led.h
+++ b/target/linux/modules/fpga/wishbone_example/wb_led/led.h
@@ -20,8 +20,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**********************************************************************
*/
-
-
#ifndef __LED_H__
#define __LED_H__
@@ -54,12 +52,9 @@
# include <mach/hardware.h>
#endif
-
/* for platform device */
#include <linux/platform_device.h>
-#endif
-
/* for debugging messages*/
#define LED_DEBUG
@@ -86,13 +81,14 @@
#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 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__ */
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-02-23 14:16:43
|
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 655e0d5908ffd7782105cde03a72b601724038de (commit)
via e1b6c94490f3503c89843aa5d01393c5e2b48c2f (commit)
from 53f7ee8c36a4b237a3aa9f1d2145012bf6592ce4 (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 655e0d5908ffd7782105cde03a72b601724038de
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 23 15:15:49 2010 +0100
[BUILDROOT] [2010.02] Add custom config file for busybox 1.16.0
commit e1b6c94490f3503c89843aa5d01393c5e2b48c2f
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 23 15:00:10 2010 +0100
[BUILDROOT] [2010.02] Makes mplayer compiles again (charset pb)
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf27_defconfig | 4 +-
.../{busybox.config => busybox-1.16.0.config} | 249 +++++++++++++-------
...-mplayer-replace_us_charset_with_utf8_one.patch | 26 ++
3 files changed, 186 insertions(+), 93 deletions(-)
copy buildroot/target/device/armadeus/{busybox.config => busybox-1.16.0.config} (83%)
create mode 100644 patches/buildroot/2010.02/102-mplayer-replace_us_charset_with_utf8_one.patch
diff --git a/buildroot/configs/apf27_defconfig b/buildroot/configs/apf27_defconfig
index 58b647f..43ce110 100644
--- a/buildroot/configs/apf27_defconfig
+++ b/buildroot/configs/apf27_defconfig
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Thu Feb 11 12:18:28 2010
+# Tue Feb 23 09:17:23 2010
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="2010.02-rc1"
@@ -261,7 +261,7 @@ BR2_BUSYBOX_VERSION_1_16_X=y
# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
BR2_BUSYBOX_VERSION="1.16.0"
BR2_PACKAGE_BUSYBOX_FULLINSTALL=y
-BR2_PACKAGE_BUSYBOX_CONFIG="target/device/armadeus/busybox.config "
+BR2_PACKAGE_BUSYBOX_CONFIG="target/device/armadeus/busybox-$(BR2_BUSYBOX_VERSION).config"
# BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is not set
# BR2_PACKAGE_BUSYBOX_SKELETON is not set
diff --git a/buildroot/target/device/armadeus/busybox.config b/buildroot/target/device/armadeus/busybox-1.16.0.config
similarity index 83%
copy from buildroot/target/device/armadeus/busybox.config
copy to buildroot/target/device/armadeus/busybox-1.16.0.config
index 274a644..cb0620f 100644
--- a/buildroot/target/device/armadeus/busybox.config
+++ b/buildroot/target/device/armadeus/busybox-1.16.0.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Busybox version: 1.12.1
-# Sat Nov 22 17:06:44 2008
+# Busybox version: 1.16.0
+# Tue Feb 23 15:13:34 2010
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -14,7 +14,8 @@ CONFIG_HAVE_DOT_CONFIG=y
#
CONFIG_DESKTOP=y
# CONFIG_EXTRA_COMPAT is not set
-# CONFIG_FEATURE_ASSUME_UNICODE is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
@@ -23,7 +24,9 @@ CONFIG_FEATURE_VERBOSE_USAGE=y
CONFIG_FEATURE_COMPRESS_USAGE=y
CONFIG_FEATURE_INSTALLER=y
CONFIG_LOCALE_SUPPORT=y
-CONFIG_GETOPT_LONG=y
+# CONFIG_FEATURE_ASSUME_UNICODE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_LONG_OPTS=y
CONFIG_FEATURE_DEVPTS=y
CONFIG_FEATURE_CLEAN_UP=y
# CONFIG_FEATURE_PIDFILE is not set
@@ -47,6 +50,7 @@ CONFIG_FEATURE_HAVE_RPC=y
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
CONFIG_LFS=y
CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_EXTRA_CFLAGS=""
#
# Debugging Options
@@ -57,8 +61,6 @@ CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set
-# CONFIG_INCLUDE_SUSv2 is not set
-# CONFIG_PARSE is not set
#
# Installation Options
@@ -71,7 +73,7 @@ CONFIG_INSTALL_APPLET_SYMLINKS=y
# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
-CONFIG_PREFIX="/home/eric/arm/apf27spe/software/buildroot/project_build_arm/apf27/root"
+CONFIG_PREFIX="/home/julien/workspace/Armadeus_SF/armadeus-git-new-buildroot-build/buildroot/output/target"
#
# Busybox Library Tuning
@@ -88,6 +90,8 @@ CONFIG_FEATURE_EDITING_SAVEHISTORY=y
CONFIG_FEATURE_TAB_COMPLETION=y
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
CONFIG_FEATURE_COPYBUF_KB=4
# CONFIG_MONOTONIC_SYSCALL is not set
@@ -111,11 +115,15 @@ CONFIG_BUNZIP2=y
# CONFIG_BZIP2 is not set
CONFIG_CPIO=y
# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
CONFIG_GUNZIP=y
CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
# CONFIG_RPM2CPIO is not set
# CONFIG_RPM is not set
CONFIG_TAR=y
@@ -127,6 +135,7 @@ CONFIG_FEATURE_TAR_FROM=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_UNLZMA=y
# CONFIG_FEATURE_LZMA_FAST is not set
@@ -142,18 +151,22 @@ CONFIG_CATV=y
CONFIG_CHGRP=y
CONFIG_CHMOD=y
CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
CONFIG_CHROOT=y
CONFIG_CKSUM=y
# CONFIG_COMM is not set
CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
CONFIG_CUT=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
+CONFIG_FEATURE_DATE_COMPAT=y
CONFIG_DD=y
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
CONFIG_FEATURE_DD_IBS_OBS=y
CONFIG_DF=y
-# CONFIG_FEATURE_DF_INODE is not set
+# CONFIG_FEATURE_DF_FANCY is not set
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
@@ -169,6 +182,7 @@ CONFIG_EXPR=y
CONFIG_EXPR_MATH_SUPPORT_64=y
CONFIG_FALSE=y
CONFIG_FOLD=y
+# CONFIG_FSYNC is not set
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
CONFIG_HOSTID=y
@@ -208,6 +222,8 @@ CONFIG_RMDIR=y
# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
CONFIG_SEQ=y
CONFIG_SHA1SUM=y
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
CONFIG_SLEEP=y
# CONFIG_FEATURE_FANCY_SLEEP is not set
# CONFIG_FEATURE_FLOAT_SLEEP is not set
@@ -262,7 +278,7 @@ CONFIG_FEATURE_AUTOWIDTH=y
CONFIG_FEATURE_HUMAN_READABLE=y
#
-# Common options for md5sum, sha1sum
+# Common options for md5sum, sha1sum, sha256sum, sha512sum
#
CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
@@ -283,6 +299,8 @@ CONFIG_FEATURE_RESIZE_PRINT=y
CONFIG_SETCONSOLE=y
# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
CONFIG_SETKEYCODES=y
CONFIG_SETLOGCONS=y
# CONFIG_SHOWKEY is not set
@@ -304,12 +322,11 @@ CONFIG_WHICH=y
# Editors
#
CONFIG_AWK=y
-CONFIG_FEATURE_AWK_MATH=y
+CONFIG_FEATURE_AWK_LIBM=y
CONFIG_CMP=y
CONFIG_DIFF=y
-CONFIG_FEATURE_DIFF_BINARY=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
CONFIG_FEATURE_DIFF_DIR=y
-# CONFIG_FEATURE_DIFF_MINIMAL is not set
# CONFIG_ED is not set
CONFIG_PATCH=y
CONFIG_SED=y
@@ -353,6 +370,7 @@ CONFIG_FEATURE_FIND_PRUNE=y
CONFIG_FEATURE_FIND_PATH=y
CONFIG_FEATURE_FIND_REGEX=y
# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
CONFIG_GREP=y
CONFIG_FEATURE_GREP_EGREP_ALIAS=y
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
@@ -367,7 +385,6 @@ CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
# Init Utilities
#
CONFIG_INIT=y
-# CONFIG_DEBUG_INIT is not set
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_FEATURE_KILL_REMOVED=y
CONFIG_FEATURE_KILL_DELAY=0
@@ -377,6 +394,8 @@ CONFIG_FEATURE_EXTRA_QUIET=y
# CONFIG_FEATURE_INIT_COREDUMPS is not set
CONFIG_FEATURE_INITRD=y
CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
CONFIG_MESG=y
#
@@ -386,13 +405,17 @@ CONFIG_FEATURE_SHADOWPASSWDS=y
# CONFIG_USE_BB_PWD_GRP is not set
# CONFIG_USE_BB_SHADOW is not set
CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
CONFIG_ADDGROUP=y
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
CONFIG_DELGROUP=y
# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_ADDUSER=y
# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
CONFIG_DELUSER=y
CONFIG_GETTY=y
CONFIG_FEATURE_UTMP=y
@@ -425,36 +448,36 @@ CONFIG_LSATTR=y
# CONFIG_MODPROBE_SMALL is not set
# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
-# CONFIG_DEPMOD is not set
-# CONFIG_FEATURE_DEPMOD_PRUNE_FANCY is not set
-# CONFIG_FEATURE_DEPMOD_ALIAS is not set
CONFIG_INSMOD=y
-# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
-# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
-# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
-CONFIG_FEATURE_INSMOD_LOAD_MAP=y
-CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL=y
CONFIG_RMMOD=y
CONFIG_LSMOD=y
CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
CONFIG_MODPROBE=y
-CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y
-CONFIG_FEATURE_MODPROBE_FANCY_ALIAS=y
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_DEPMOD is not set
#
# Options common to multiple modutils
#
-CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
# CONFIG_FEATURE_2_4_MODULES is not set
-CONFIG_FEATURE_2_6_MODULES=y
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
-# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
#
# Linux System Utilities
#
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
CONFIG_DMESG=y
CONFIG_FEATURE_DMESG_PRETTY=y
CONFIG_FBSET=y
@@ -473,9 +496,13 @@ CONFIG_FEATURE_FDISK_WRITABLE=y
# CONFIG_FINDFS is not set
CONFIG_FREERAMDISK=y
# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_EXT2 is not set
# CONFIG_MKFS_MINIX is not set
# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
CONFIG_GETOPT=y
+CONFIG_FEATURE_GETOPT_LONG=y
CONFIG_HEXDUMP=y
# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
# CONFIG_HD is not set
@@ -485,6 +512,8 @@ CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
CONFIG_IPCRM=y
CONFIG_IPCS=y
CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
CONFIG_MDEV=y
CONFIG_FEATURE_MDEV_CONF=y
CONFIG_FEATURE_MDEV_RENAME=y
@@ -492,11 +521,12 @@ CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
CONFIG_FEATURE_MDEV_EXEC=y
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
CONFIG_MKSWAP=y
-# CONFIG_FEATURE_MKSWAP_V0 is not set
+# CONFIG_FEATURE_MKSWAP_UUID is not set
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
# CONFIG_VOLUMEID is not set
# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
# CONFIG_FEATURE_VOLUMEID_FAT is not set
# CONFIG_FEATURE_VOLUMEID_HFS is not set
@@ -527,6 +557,7 @@ CONFIG_RDATE=y
CONFIG_READPROFILE=y
# CONFIG_RTCWAKE is not set
# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
CONFIG_SETARCH=y
CONFIG_SWAPONOFF=y
# CONFIG_FEATURE_SWAPON_PRI is not set
@@ -545,6 +576,9 @@ CONFIG_FEATURE_MOUNT_LOOP=y
#
CONFIG_ADJTIMEX=y
# CONFIG_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
# CONFIG_CHAT is not set
# CONFIG_FEATURE_CHAT_NOFAIL is not set
# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
@@ -555,18 +589,26 @@ CONFIG_ADJTIMEX=y
# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
CONFIG_CHRT=y
CONFIG_CROND=y
-CONFIG_DEBUG_CROND_OPTION=y
+# CONFIG_FEATURE_CROND_D is not set
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR="/var/spool/cron"
CONFIG_CRONTAB=y
CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
CONFIG_EJECT=y
# CONFIG_FEATURE_EJECT_SCSI is not set
# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
# CONFIG_INOTIFYD is not set
CONFIG_LAST=y
CONFIG_FEATURE_LAST_SMALL=y
@@ -575,9 +617,11 @@ CONFIG_LESS=y
CONFIG_FEATURE_LESS_MAXLINES=9999999
CONFIG_FEATURE_LESS_BRACKETS=y
CONFIG_FEATURE_LESS_FLAGS=y
-CONFIG_FEATURE_LESS_FLAGCS=y
# CONFIG_FEATURE_LESS_MARKS is not set
CONFIG_FEATURE_LESS_REGEXP=y
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
CONFIG_HDPARM=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
@@ -601,13 +645,17 @@ CONFIG_STRINGS=y
CONFIG_TASKSET=y
CONFIG_FEATURE_TASKSET_FANCY=y
CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WALL is not set
CONFIG_WATCHDOG=y
#
# Networking Utilities
#
CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
# CONFIG_ARP is not set
@@ -618,6 +666,9 @@ CONFIG_ARPING=y
CONFIG_DNSD=y
CONFIG_ETHER_WAKE=y
# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
CONFIG_FTPGET=y
CONFIG_FTPPUT=y
# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
@@ -625,11 +676,9 @@ CONFIG_HOSTNAME=y
# CONFIG_HTTPD is not set
# CONFIG_FEATURE_HTTPD_RANGES is not set
# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
-# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
# CONFIG_FEATURE_HTTPD_SETUID is not set
# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
-# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
# CONFIG_FEATURE_HTTPD_CGI is not set
# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
@@ -643,6 +692,7 @@ CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y
CONFIG_FEATURE_IFCONFIG_HW=y
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
CONFIG_IFUPDOWN=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
CONFIG_FEATURE_IFUPDOWN_IP=y
@@ -684,41 +734,45 @@ CONFIG_NETSTAT=y
# CONFIG_FEATURE_NETSTAT_WIDE is not set
# CONFIG_FEATURE_NETSTAT_PRG is not set
CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
CONFIG_PING=y
# CONFIG_PING6 is not set
CONFIG_FEATURE_FANCY_PING=y
# CONFIG_PSCAN is not set
CONFIG_ROUTE=y
-# CONFIG_SENDMAIL is not set
-# CONFIG_FETCHMAIL is not set
# CONFIG_SLATTACH is not set
CONFIG_TELNET=y
CONFIG_FEATURE_TELNET_TTYPE=y
CONFIG_FEATURE_TELNET_AUTOLOGIN=y
CONFIG_TELNETD=y
# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
CONFIG_TFTP=y
# CONFIG_TFTPD is not set
CONFIG_FEATURE_TFTP_GET=y
CONFIG_FEATURE_TFTP_PUT=y
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
-# CONFIG_DEBUG_TFTP is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
-CONFIG_APP_UDHCPD=y
-CONFIG_APP_DHCPRELAY=y
-CONFIG_APP_DUMPLEASES=y
+# CONFIG_UDHCPD is not set
+# CONFIG_DHCPRELAY is not set
+# CONFIG_DUMPLEASES is not set
# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
-CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
-CONFIG_APP_UDHCPC=y
+CONFIG_DHCPD_LEASES_FILE=""
+CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
# CONFIG_FEATURE_UDHCP_PORT is not set
-# CONFIG_FEATURE_UDHCP_DEBUG is not set
-# CONFIG_FEATURE_RFC3397 is not set
-CONFIG_DHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
CONFIG_VCONFIG=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
@@ -726,9 +780,29 @@ CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
# CONFIG_ZCIP is not set
# CONFIG_TCPSVD is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
# CONFIG_UDPSVD is not set
#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
# Process Utilities
#
CONFIG_FREE=y
@@ -745,36 +819,61 @@ CONFIG_FEATURE_PIDOF_OMIT=y
CONFIG_PS=y
CONFIG_FEATURE_PS_WIDE=y
# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
CONFIG_RENICE=y
CONFIG_BB_SYSCTL=y
CONFIG_TOP=y
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
CONFIG_FEATURE_TOPMEM=y
+# CONFIG_FEATURE_SHOW_THREADS is not set
CONFIG_UPTIME=y
CONFIG_WATCH=y
#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
# Shells
#
CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
-# CONFIG_FEATURE_SH_IS_MSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
-
-#
-# Ash Shell Options
-#
CONFIG_ASH_BASH_COMPAT=y
CONFIG_ASH_JOB_CONTROL=y
-CONFIG_ASH_READ_NCHARS=y
-CONFIG_ASH_READ_TIMEOUT=y
CONFIG_ASH_ALIAS=y
-CONFIG_ASH_MATH_SUPPORT=y
-CONFIG_ASH_MATH_SUPPORT_64=y
# CONFIG_ASH_GETOPTS is not set
CONFIG_ASH_BUILTIN_ECHO=y
CONFIG_ASH_BUILTIN_PRINTF=y
@@ -785,6 +884,7 @@ CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
CONFIG_ASH_RANDOM_SUPPORT=y
CONFIG_ASH_EXPAND_PRMT=y
CONFIG_HUSH=y
+CONFIG_HUSH_BASH_COMPAT=y
# CONFIG_HUSH_HELP is not set
CONFIG_HUSH_INTERACTIVE=y
# CONFIG_HUSH_JOB is not set
@@ -792,12 +892,14 @@ CONFIG_HUSH_INTERACTIVE=y
CONFIG_HUSH_IF=y
CONFIG_HUSH_LOOPS=y
CONFIG_HUSH_CASE=y
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
# CONFIG_LASH is not set
# CONFIG_MSH is not set
-
-#
-# Bourne Shell Options
-#
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
CONFIG_FEATURE_SH_EXTRA_QUIET=y
# CONFIG_FEATURE_SH_STANDALONE is not set
# CONFIG_FEATURE_SH_NOFORK is not set
@@ -811,43 +913,8 @@ CONFIG_FEATURE_ROTATE_LOGFILE=y
CONFIG_FEATURE_REMOTE_LOG=y
# CONFIG_FEATURE_SYSLOGD_DUP is not set
# CONFIG_FEATURE_IPC_SYSLOG is not set
-CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
# CONFIG_LOGREAD is not set
# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
CONFIG_KLOGD=y
CONFIG_LOGGER=y
-
-#
-# Runit Utilities
-#
-# CONFIG_RUNSV is not set
-# CONFIG_RUNSVDIR is not set
-# CONFIG_SV is not set
-# CONFIG_SVLOGD is not set
-# CONFIG_CHPST is not set
-# CONFIG_SETUIDGID is not set
-# CONFIG_ENVUIDGID is not set
-# CONFIG_ENVDIR is not set
-# CONFIG_SOFTLIMIT is not set
-# CONFIG_CHCON is not set
-# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
-# CONFIG_GETENFORCE is not set
-# CONFIG_GETSEBOOL is not set
-# CONFIG_LOAD_POLICY is not set
-# CONFIG_MATCHPATHCON is not set
-# CONFIG_RESTORECON is not set
-# CONFIG_RUNCON is not set
-# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
-# CONFIG_SELINUXENABLED is not set
-# CONFIG_SETENFORCE is not set
-# CONFIG_SETFILES is not set
-# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
-# CONFIG_SETSEBOOL is not set
-# CONFIG_SESTATUS is not set
-
-#
-# Print Utilities
-#
-# CONFIG_LPD is not set
-# CONFIG_LPR is not set
-# CONFIG_LPQ is not set
diff --git a/patches/buildroot/2010.02/102-mplayer-replace_us_charset_with_utf8_one.patch b/patches/buildroot/2010.02/102-mplayer-replace_us_charset_with_utf8_one.patch
new file mode 100644
index 0000000..ce149b3
--- /dev/null
+++ b/patches/buildroot/2010.02/102-mplayer-replace_us_charset_with_utf8_one.patch
@@ -0,0 +1,26 @@
+The mplayer configure script was failing with:
+
+ Checking for iconv program ... no
+ No working iconv program found, use
+ --charset=UTF-8 to continue anyway.
+ If you also have problems with iconv library functions use --charset=noconv.
+ Messages in the GTK-2 interface will be broken then.
+
+Therefore, we pass --charset=UTF-8 instead of --charset=US-ASCII.
+
+Signed-off-by: Thomas Petazzoni <tho...@fr...>
+
+diff --git a/package/multimedia/mplayer/mplayer.mk b/package/multimedia/mplayer/mplayer.mk
+index 3d56ee0..538bac9 100644
+--- a/package/multimedia/mplayer/mplayer.mk
++++ b/package/multimedia/mplayer/mplayer.mk
+@@ -54,7 +54,7 @@ $(MPLAYER_DIR)/.configured: $(MPLAYER_DIR)/.unpacked
+ --as=$(TARGET_CROSS)as \
+ --with-extraincdir=$(STAGING_DIR)/usr/include \
+ --with-extralibdir=$(STAGING_DIR)/lib \
+- --charset=US-ASCII \
++ --charset=UTF-8 \
+ --enable-mad \
+ --enable-fbdev \
+ $(MPLAYER_ENDIAN) \
+-- 1.6.3.3
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-02-22 20:22:09
|
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 53f7ee8c36a4b237a3aa9f1d2145012bf6592ce4 (commit)
via 0fb8ea19c03ed071481ec09637ef7110faf40358 (commit)
from bfc9119170dad9ba1bed11670101be21e47517d3 (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 53f7ee8c36a4b237a3aa9f1d2145012bf6592ce4
Merge: 0fb8ea19c03ed071481ec09637ef7110faf40358 bfc9119170dad9ba1bed11670101be21e47517d3
Author: Julien Boibessot <jul...@ar...>
Date: Mon Feb 22 18:20:42 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 0fb8ea19c03ed071481ec09637ef7110faf40358
Author: Julien Boibessot <jul...@ar...>
Date: Mon Feb 22 18:20:19 2010 +0100
[BUILDROOT] [2010.02] Updates to latest available snapshot
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
...config.sh-sets-THIS_MINOR-to-0-by-default.patch | 29 ----------------
...pdates_source_repository_and_bump_version.patch | 32 -----------------
...libform_libmenu_and_libpanel_from_ncurses.patch | 36 --------------------
4 files changed, 1 insertions(+), 98 deletions(-)
delete mode 100644 patches/buildroot/2010.02/100-get_linux_config.sh-sets-THIS_MINOR-to-0-by-default.patch
delete mode 100644 patches/buildroot/2010.02/102-rsync-updates_source_repository_and_bump_version.patch
delete mode 100644 patches/buildroot/2010.02/103-alsamixer-now_requires_libform_libmenu_and_libpanel_from_ncurses.patch
diff --git a/Makefile b/Makefile
index 549f0eb..9b1e1b5 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ export ARMADEUS_TOPDIR
#--- User configurable stuff:
#BUILDROOT_SITE:=http://buildroot.uclibc.org/downloads/snapshots
-#BUILDROOT_VERSION:=20100211
+#BUILDROOT_VERSION:=20100221
#BUILDROOT_PATCH_DIR:=$(ARMADEUS_TOPDIR)/patches/buildroot/2010.02
BUILDROOT_SITE:=http://downloads.sourceforge.net/armadeus
BUILDROOT_VERSION:=20081103
diff --git a/patches/buildroot/2010.02/100-get_linux_config.sh-sets-THIS_MINOR-to-0-by-default.patch b/patches/buildroot/2010.02/100-get_linux_config.sh-sets-THIS_MINOR-to-0-by-default.patch
deleted file mode 100644
index edf01db..0000000
--- a/patches/buildroot/2010.02/100-get_linux_config.sh-sets-THIS_MINOR-to-0-by-default.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 13cef349fdc8d01d09e8b1d62f1dd32376d53523 Mon Sep 17 00:00:00 2001
-From: Julien Boibessot <jul...@ar...>
-Date: Tue, 9 Feb 2010 15:18:29 +0100
-Subject: [PATCH] get_linux_config.sh: sets THIS_MINOR to 0 if not valid.
-
-Sets THIS_MINOR to 0 if not valid, ie when processing a Linux config file who do not
-have a minor number extension; ex: "<name>-linux-2.6.<major>.config"
-Otherwise bash is raising an error/exception (line 59) and script can not complete.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
----
- scripts/get_linux_config.sh | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/scripts/get_linux_config.sh b/scripts/get_linux_config.sh
-index 1950e9d..5cd0e37 100755
---- a/scripts/get_linux_config.sh
-+++ b/scripts/get_linux_config.sh
-@@ -35,6 +35,7 @@ function linux_version()
- KERNEL=`echo ${KCONFIG} | sed s/.*linux-2.6./linux-2.6./g -`
- THIS_MAJOR=${KERNEL:10:2}
- THIS_MINOR=${KERNEL:13}
-+ THIS_MINOR=${THIS_MINOR:=0}
- }
-
- # Try to be careful...
---
-1.6.0.4
-
diff --git a/patches/buildroot/2010.02/102-rsync-updates_source_repository_and_bump_version.patch b/patches/buildroot/2010.02/102-rsync-updates_source_repository_and_bump_version.patch
deleted file mode 100644
index 4d8fda9..0000000
--- a/patches/buildroot/2010.02/102-rsync-updates_source_repository_and_bump_version.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0296eef9774b080a5ddd960f9bc7694c4b590f7b Mon Sep 17 00:00:00 2001
-From: Julien Boibessot <jul...@ar...>
-Date: Thu, 11 Feb 2010 13:40:40 +0100
-Subject: [PATCH] Updates rsync source repository
-
-rsync source repository has moved (?).
-Bump version while we are at it.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
----
- package/rsync/rsync.mk | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/package/rsync/rsync.mk b/package/rsync/rsync.mk
-index 1ed6812..e1bb28e 100644
---- a/package/rsync/rsync.mk
-+++ b/package/rsync/rsync.mk
-@@ -4,9 +4,9 @@
- #
- #############################################################
-
--RSYNC_VERSION:=3.0.6
-+RSYNC_VERSION:=3.0.7
- RSYNC_SOURCE:=rsync-$(RSYNC_VERSION).tar.gz
--RSYNC_SITE:=http://rsync.samba.org/ftp/rsync
-+RSYNC_SITE:=http://rsync.samba.org/ftp/rsync/src
- RSYNC_INSTALL_STAGING:=NO
- RSYNC_INSTALL_TARGET:=YES
- RSYNC_CONF_OPT=$(if $(BR2_ENABLE_DEBUG),--enable-debug,--disable-debug)
---
-1.6.0.4
-
diff --git a/patches/buildroot/2010.02/103-alsamixer-now_requires_libform_libmenu_and_libpanel_from_ncurses.patch b/patches/buildroot/2010.02/103-alsamixer-now_requires_libform_libmenu_and_libpanel_from_ncurses.patch
deleted file mode 100644
index 54f3b6d..0000000
--- a/patches/buildroot/2010.02/103-alsamixer-now_requires_libform_libmenu_and_libpanel_from_ncurses.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 4ad3a1b57fb94d8fd8cf5a6e215afbcc16f50c23 Mon Sep 17 00:00:00 2001
-From: Julien Boibessot <jul...@ar...>
-Date: Thu, 11 Feb 2010 17:27:06 +0100
-Subject: [PATCH] alsamixer now seems to need libform, libmenu & libpanel (from ncurses)
-
-Without this patch alsamixer complains about missing libs and
-ldd says:
- libform.so.5 => not found
- libmenu.so.5 => not found
- libpanel.so.5 => not found
- libncurses.so.5 => /usr/lib/libncurses.so.5 (0x4000e000)
- libasound.so.2 => /usr/lib/libasound.so.2 (0x40056000)
- ... <cut>
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
----
- package/multimedia/alsa-utils/Config.in | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/package/multimedia/alsa-utils/Config.in b/package/multimedia/alsa-utils/Config.in
-index 54ab3f9..04057f4 100644
---- a/package/multimedia/alsa-utils/Config.in
-+++ b/package/multimedia/alsa-utils/Config.in
-@@ -24,6 +24,9 @@ config BR2_PACKAGE_ALSA_UTILS_ALSACTL
- config BR2_PACKAGE_ALSA_UTILS_ALSAMIXER
- bool "alsamixer"
- select BR2_PACKAGE_NCURSES
-+ select BR2_PACKAGE_NCURSES_TARGET_PANEL
-+ select BR2_PACKAGE_NCURSES_TARGET_FORM
-+ select BR2_PACKAGE_NCURSES_TARGET_MENU
- default y
-
- config BR2_PACKAGE_ALSA_UTILS_AMIDI
---
-1.6.0.4
-
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-02-22 14:27: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 bfc9119170dad9ba1bed11670101be21e47517d3 (commit)
via 261a630daa5615b4212bfeb4b6198c5140e5e70a (commit)
via b888e0ff353290ac0fad5af8624369c8c85fc610 (commit)
via b6751f2cb5ed7e398fd6fcf330e00fae589ae54e (commit)
from 7466ac2121ad8cb5b150a0c3298568f848e90ec9 (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 bfc9119170dad9ba1bed11670101be21e47517d3
Merge: 261a630daa5615b4212bfeb4b6198c5140e5e70a 7466ac2121ad8cb5b150a0c3298568f848e90ec9
Author: Julien Boibessot <jul...@ar...>
Date: Mon Feb 22 15:26:19 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 261a630daa5615b4212bfeb4b6198c5140e5e70a
Author: Julien Boibessot <jul...@ar...>
Date: Mon Feb 22 15:26:02 2010 +0100
[LINUX] Add (preliminary) support for USB device functionnality of APF27 module
commit b888e0ff353290ac0fad5af8624369c8c85fc610
Merge: b6751f2cb5ed7e398fd6fcf330e00fae589ae54e 663489491607550291d1d6f795b74f6177786c56
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 18 11:36:16 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit b6751f2cb5ed7e398fd6fcf330e00fae589ae54e
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 16 12:05:45 2010 +0100
[LINUX] Comment some 2.6.29 patches
-----------------------------------------------------------------------
Summary of changes:
buildroot/local/apf27_test/linux-2.6.29.4.config | 36 +-
.../armadeus/apf27/apf27-linux-2.6.29.config | 36 +-
.../2.6.29/281-apf27-armadeus-add_apf27.c.patch | 130 +-
.../287-apf27-armadeus-fix_usb_otg_int.patch | 2 +
.../296-apf27-armadeus-imx27-usb-host1.patch | 5 +
..._iMX3x_support_to_the_fsl_usb2_udc_driver.patch | 5154 ++++++++++++++++++++
...dc_core-fix_kernel_oops_on_module_removal.patch | 52 +
.../355c-armadeus-mx2-devices-add_usb_device.patch | 84 +
...rmadeus-fsl_udc-add_platform_init_support.patch | 67 +
9 files changed, 5528 insertions(+), 38 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355a-denx-fsl_udc-Add_iMX3x_support_to_the_fsl_usb2_udc_driver.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355b-montavista-fsl_udc_core-fix_kernel_oops_on_module_removal.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355c-armadeus-mx2-devices-add_usb_device.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355d-armadeus-fsl_udc-add_platform_init_support.patch
diff --git a/buildroot/local/apf27_test/linux-2.6.29.4.config b/buildroot/local/apf27_test/linux-2.6.29.4.config
index bfe8814..58fd748 100644
--- a/buildroot/local/apf27_test/linux-2.6.29.4.config
+++ b/buildroot/local/apf27_test/linux-2.6.29.4.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29.6
-# Mon Dec 14 18:25:57 2009
+# Mon Feb 22 13:40:04 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1323,6 +1323,7 @@ CONFIG_USB_EHCI_MXC=y
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
#
# USB Device Class drivers
@@ -1390,7 +1391,38 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_VST is not set
-# CONFIG_USB_GADGET is not set
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DEBUG_FILES=y
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+CONFIG_USB_GADGET_FSL_USB2=y
+CONFIG_USB_FSL_USB2=y
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+# CONFIG_USB_FILE_STORAGE is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
#
# OTG and related infrastructure
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 dc5c9ad..a2239f2 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
-# Thu Dec 17 12:58:12 2009
+# Mon Feb 22 13:40:04 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -1320,6 +1320,7 @@ CONFIG_USB_EHCI_MXC=y
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
#
# USB Device Class drivers
@@ -1387,7 +1388,38 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_VST is not set
-# CONFIG_USB_GADGET is not set
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DEBUG_FILES=y
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+CONFIG_USB_GADGET_FSL_USB2=y
+CONFIG_USB_FSL_USB2=y
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+# CONFIG_USB_FILE_STORAGE is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
#
# OTG and related infrastructure
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 782a065..c88a75b 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,8 +9,8 @@ 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-01-21 11:06:41.000000000 +0100
-@@ -0,0 +1,727 @@
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27.c 2010-02-22 14:38:52.000000000 +0100
+@@ -0,0 +1,789 @@
+ /*
+ * apf27.c
+ *
@@ -62,6 +62,7 @@ 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"
@@ -242,8 +243,7 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#endif /* CONFIG_FEC_OLD */
+
+
-+/* APF27 has an onboard PHY for OTG USB port */
-+#ifdef CONFIG_USB_EHCI_MXC
++/* APF27 has an onboard PHY (ISP1504) on OTG USB port */
+static int mxc_usbotg_pins[] = {
+ PE0_PF_USBOTG_NXT,
+ PE1_PF_USBOTG_STP,
@@ -259,9 +259,9 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ PC13_PF_USBOTG_DATA3,
+};
+
-+static int isp1504_set_vbus_power(void __iomem *view, int on)
++static int isp1504_check_presence(void __iomem *view)
+{
-+ int vid, pid, ret = 0;
++ int vid, pid;
+
+ vid = (ulpi_read(ISP1504_VID_HIGH, view) << 8) |
+ ulpi_read(ISP1504_VID_LOW, view);
@@ -274,6 +274,17 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ return -1;
+ }
+
++ return 0;
++}
++
++static int isp1504_set_vbus_power(void __iomem *view, int on)
++{
++ int ret = 0;
++
++ ret = isp1504_check_presence(view);
++ if (ret)
++ return ret;
++
+ if (on) {
+ /* force disconnection of the DM/DP signals. This
+ avoid powering the connected device through these lines */
@@ -300,6 +311,19 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+ return ret;
+}
+
++static int isp1504_set_device(void __iomem *view)
++{
++ int ret = 0;
++
++ ret = isp1504_check_presence(view);
++ if (ret)
++ return ret;
++
++ ret = ulpi_clear(0x06, ISP1504_OTGCTL, view);
++
++ return ret;
++}
++
+static void isp1504_suspend(void __iomem *view)
+{
+ /* isp1504_set_vbus_power(view, 0); needed ? */
@@ -308,61 +332,97 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+
+static void isp1504_resume(void __iomem *view)
+{
-+ /* uggly but the STP line must be set to 1 before the first PHY access
++ /* uggly but the STP line must be set to 1 before the first PHY access
+ in order to wake up the ULPI clock of the PHY. */
+ gpio_set_value(GPIO_PORTE | 1, 1);
+ /* deassert STP (gpio mode) */
+ mxc_gpio_mode(GPIO_PORTE | 1 | GPIO_OUT | GPIO_GPIO);
+ mdelay(1);
-+ /* STP now managed by the USB host ctrl */
++ /* STP now managed by the USB host ctrl */
+ mxc_gpio_mode(PE1_PF_USBOTG_STP);
+}
+
++#define UOG_USBCMD 0x140
++#define UOG_ULPIVIEW 0x170
++#define UOG_PORTSC1 0x184
++#define USB_CTRL 0x600
++#define PORTSC_PTS_MASK (3 << 30)
++#define PORTSC_PTS_ULPI (2 << 30)
++
++static void apf27_usbotg_reset(void)
++{
++ uint32_t temp;
++
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + UOG_USBCMD);
++ temp |= 0x02;
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + UOG_USBCMD);
++ pr_debug("reset controller: 0x%08x\n", temp);
++ mdelay(50);
++}
++
++static int otg_mode_host = 1;
++
++static int __init apf27_otg_mode(char *options)
++{
++ if (!strcmp(options, "host"))
++ otg_mode_host = 1;
++ else if (!strcmp(options, "device"))
++ otg_mode_host = 0;
++ else {
++ pr_info("otg_mode neither \"host\" nor \"device\". "
++ "Defaulting to host\n");
++ }
++
++ return 0;
++}
++__setup("otg_mode=", apf27_otg_mode);
++
+static int apf27_usbotg_init(struct platform_device *pdev)
+{
+ int ret;
+ uint32_t temp;
+
+ ret = mxc_gpio_setup_multiple_pins(mxc_usbotg_pins,
-+ ARRAY_SIZE(mxc_usbotg_pins), "usbotg");
++ ARRAY_SIZE(mxc_usbotg_pins), "USB OTG");
+ if (ret)
+ return ret;
+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ pr_debug("USB_CTRL before: 0x%08x\n", temp);
++ /* Tweak power/wake up handling */
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + USB_CTRL);
+ temp &= ~( (3 << 29) | 1 );
+ temp |= (1 << 24) | (1 << 27) | (1 << 28);
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ pr_debug("USB_CTRL after: 0x%08x\n", temp);
-+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x184);
-+ pr_debug("PORTSC1 before: 0x%08x\n", temp);
-+ temp &= ~(3 << 30);
-+ temp |= 2 << 30;
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x184);
-+ pr_debug("PORTSC1 after: 0x%08x\n", temp);
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + USB_CTRL);
+
++ /* Select ULPI PHY */
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + UOG_PORTSC1);
++ temp = (temp & ~PORTSC_PTS_MASK) | PORTSC_PTS_ULPI;
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + UOG_PORTSC1);
+ mdelay(10);
+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x140);
-+ temp |= 0x02; /* reset controller */
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x140);
-+ pr_debug("reset controller: 0x%08x\n", temp);
-+ mdelay(50);
++ apf27_usbotg_reset();
++
++ if (otg_mode_host) {
++ ret = isp1504_set_vbus_power((void __iomem *)(IO_ADDRESS(OTG_BASE_ADDR + UOG_ULPIVIEW)), 1);
++ } else {
++ ret = isp1504_set_device((void __iomem *)(IO_ADDRESS(OTG_BASE_ADDR + UOG_ULPIVIEW)));
++ }
+
+ if (ret)
+ mxc_gpio_release_multiple_pins(mxc_usbotg_pins,
+ ARRAY_SIZE(mxc_usbotg_pins));
+
-+ ret = isp1504_set_vbus_power((void __iomem *)(IO_ADDRESS(OTG_BASE_ADDR + 0x170)), 1);
-+
+ return ret;
+}
+
+struct mxc_usb2_platform_data ehci0_pdata = {
+ .init = apf27_usbotg_init,
+};
-+#endif /* CONFIG_USB_EHCI_MXC */
++
++static struct fsl_usb2_platform_data otg_device_pdata = {
++ .init = apf27_usbotg_init,
++ .operating_mode = FSL_USB2_DR_DEVICE,
++ .phy_mode = FSL_USB2_PHY_ULPI,
++};
+
+
+/* APF27 frequency scaling stuff */
@@ -684,9 +744,11 @@ Index: linux-2.6.29.6/arch/arm/mach-mx2/apf27.c
+#ifdef CONFIG_WATCHDOG
+ mxc_register_device(&mxc_wdt, NULL);
+#endif
-+#ifdef CONFIG_USB_EHCI_MXC
-+ mxc_register_device(&mxc_otg, &ehci0_pdata);
-+#endif
++ if (otg_mode_host) {
++ mxc_register_device(&mxc_otg_host, &ehci0_pdata);
++ } else {
++ mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
++ }
+#ifdef CONFIG_I2C
+ mxc_register_device(&imx_i2c_device1, &apf27_i2c_1_data);
+ i2c_register_board_info(1, apf27_i2c_devices_bus1,
@@ -741,7 +803,7 @@ 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-01-26 22:31:08.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev.c 2010-02-22 14:38:13.000000000 +0100
@@ -0,0 +1,1019 @@
+ /*
+ * apf27-dev.c
@@ -1765,7 +1827,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-01-21 11:06:41.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-lcd.c 2010-02-16 13:17:29.000000000 +0100
@@ -0,0 +1,220 @@
+/*
+ * apf27-lcd.c
@@ -1990,7 +2052,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-01-26 19:01:12.000000000 +0100
++++ linux-2.6.29.6/arch/arm/mach-mx2/apf27-dev-ext-apw.c 2010-02-16 13:17:29.000000000 +0100
@@ -0,0 +1,201 @@
+ /*
+ * apf27-dev-ext-apw.c
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/287-apf27-armadeus-fix_usb_otg_int.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/287-apf27-armadeus-fix_usb_otg_int.patch
index ff2ffd3..0ed7e65 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/287-apf27-armadeus-fix_usb_otg_int.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/287-apf27-armadeus-fix_usb_otg_int.patch
@@ -1,5 +1,7 @@
Interrupt number of USB OTG module is not correct on MX2.
+Integrated in latest kernels.
+
Signed-off-by: Eric Jarrige <eri...@ar...>
Index: linux-2.6.29/arch/arm/mach-mx2/devices.c
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/296-apf27-armadeus-imx27-usb-host1.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/296-apf27-armadeus-imx27-usb-host1.patch
index b17a46a..f561cb7 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/296-apf27-armadeus-imx27-usb-host1.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/296-apf27-armadeus-imx27-usb-host1.patch
@@ -1,3 +1,8 @@
+Add USB Host 1 ressources + correct ID of USB Host 2
+
+Integrated in latest kernels with different names for platform devices.
+Ex: mxc_ehci1 -> mxc_usbh1
+
Index: linux-2.6.29.4/arch/arm/mach-mx2/devices.c
===================================================================
--- linux-2.6.29.4.orig/arch/arm/mach-mx2/devices.c 2009-06-04 11:30:50.000000000 +0200
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355a-denx-fsl_udc-Add_iMX3x_support_to_the_fsl_usb2_udc_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355a-denx-fsl_udc-Add_iMX3x_support_to_the_fsl_usb2_udc_driver.patch
new file mode 100644
index 0000000..447dde9
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/355a-denx-fsl_udc-Add_iMX3x_support_to_the_fsl_usb2_udc_driver.patch
@@ -0,0 +1,5154 @@
+From 54e4026b64a970303349b952866641a7804ef594 Mon Sep 17 00:00:00 2001
+From: Guennadi Liakhovetski <lg...@de...>
+Date: Wed, 15 Apr 2009 14:25:33 +0200
+Subject: [PATCH] USB: gadget: Add i.MX3x support to the fsl_usb2_udc driver
+
+This patch adds support for i.MX3x (only tested with i.MX31 so far) ARM
+SoCs to the fsl_usb2_udc driver. It also moves PHY configuration before
+controller reset, because otherwise an ULPI PHY doesn't get a reset and
+doesn't function after a reboot. The problem with longer control transfers
+is still not fixed. The patch renames the fsl_usb2_udc.c file to
+fsl_udc_core.c to preserve the same module name for user-space
+backwards compatibility.
+
+Signed-off-by: Guennadi Liakhovetski <lg...@de...>
+Signed-off-by: Greg Kroah-Hartman <gr...@su...>
+---
+ drivers/usb/gadget/Kconfig | 2 +-
+ drivers/usb/gadget/Makefile | 4 +
+ drivers/usb/gadget/fsl_mx3_udc.c | 95 ++
+ drivers/usb/gadget/fsl_udc_core.c | 2491 +++++++++++++++++++++++++++++++++++++
+ drivers/usb/gadget/fsl_usb2_udc.c | 2468 ------------------------------------
+ drivers/usb/gadget/fsl_usb2_udc.h | 18 +
+ 6 files changed, 2609 insertions(+), 2469 deletions(-)
+ create mode 100644 drivers/usb/gadget/fsl_mx3_udc.c
+ create mode 100644 drivers/usb/gadget/fsl_udc_core.c
+ delete mode 100644 drivers/usb/gadget/fsl_usb2_udc.c
+
+diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
+index 772dd3b..5de9b4f 100644
+--- a/drivers/usb/gadget/Kconfig
++++ b/drivers/usb/gadget/Kconfig
+@@ -156,7 +156,7 @@ config USB_ATMEL_USBA
+
+ config USB_GADGET_FSL_USB2
+ boolean "Freescale Highspeed USB DR Peripheral Controller"
+- depends on FSL_SOC
++ depends on FSL_SOC || ARCH_MXC
+ select USB_GADGET_DUALSPEED
+ help
+ Some of Freescale PowerPC processors have a High Speed
+diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
+index 39a51d7..c3fe063 100644
+--- a/drivers/usb/gadget/Makefile
++++ b/drivers/usb/gadget/Makefile
+@@ -18,6 +18,10 @@ obj-$(CONFIG_USB_S3C2410) += s3c2410_udc.o
+ obj-$(CONFIG_USB_AT91) += at91_udc.o
+ obj-$(CONFIG_USB_ATMEL_USBA) += atmel_usba_udc.o
+ obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
++fsl_usb2_udc-objs := fsl_udc_core.o
++ifeq ($(CONFIG_ARCH_MXC),y)
++fsl_usb2_udc-objs += fsl_mx3_udc.o
++endif
+ obj-$(CONFIG_USB_M66592) += m66592-udc.o
+ obj-$(CONFIG_USB_FSL_QE) += fsl_qe_udc.o
+ obj-$(CONFIG_USB_CI13XXX) += ci13xxx_udc.o
+diff --git a/drivers/usb/gadget/fsl_mx3_udc.c b/drivers/usb/gadget/fsl_mx3_udc.c
+new file mode 100644
+index 0000000..4bc2bf3
+--- /dev/null
++++ b/drivers/usb/gadget/fsl_mx3_udc.c
+@@ -0,0 +1,95 @@
++/*
++ * Copyright (C) 2009
++ * Guennadi Liakhovetski, DENX Software Engineering, <lg...@de...>
++ *
++ * Description:
++ * Helper routines for i.MX3x SoCs from Freescale, needed by the fsl_usb2_udc.c
++ * driver to function correctly on these 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.
++ */
++#include <linux/clk.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++#include <linux/fsl_devices.h>
++#include <linux/platform_device.h>
++
++static struct clk *mxc_ahb_clk;
++static struct clk *mxc_usb_clk;
++
++int fsl_udc_clk_init(struct platform_device *pdev)
++{
++ struct fsl_usb2_platform_data *pdata;
++ unsigned long freq;
++ int ret;
++
++ pdata = pdev->dev.platform_data;
++
++ mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb");
++ if (IS_ERR(mxc_ahb_clk))
++ return PTR_ERR(mxc_ahb_clk);
++
++ ret = clk_enable(mxc_ahb_clk);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n");
++ goto eenahb;
++ }
++
++ /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
++ mxc_usb_clk = clk_get(&pdev->dev, "usb");
++ if (IS_ERR(mxc_usb_clk)) {
++ dev_err(&pdev->dev, "clk_get(\"usb\") failed\n");
++ ret = PTR_ERR(mxc_usb_clk);
++ goto egusb;
++ }
++
++ freq = clk_get_rate(mxc_usb_clk);
++ if (pdata->phy_mode != FSL_USB2_PHY_ULPI &&
++ (freq < 59999000 || freq > 60001000)) {
++ dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq);
++ goto eclkrate;
++ }
++
++ ret = clk_enable(mxc_usb_clk);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "clk_enable(\"usb_clk\") failed\n");
++ goto eenusb;
++ }
++
++ return 0;
++
++eenusb:
++eclkrate:
++ clk_put(mxc_usb_clk);
++ mxc_usb_clk = NULL;
++egusb:
++ clk_disable(mxc_ahb_clk);
++eenahb:
++ clk_put(mxc_ahb_clk);
++ return ret;
++}
++
++void fsl_udc_clk_finalize(struct platform_device *pdev)
++{
++ struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
++
++ /* ULPI transceivers don't need usbpll */
++ if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
++ clk_disable(mxc_usb_clk);
++ clk_put(mxc_usb_clk);
++ mxc_usb_clk = NULL;
++ }
++}
++
++void fsl_udc_clk_release(void)
++{
++ if (mxc_usb_clk) {
++ clk_disable(mxc_usb_clk);
++ clk_put(mxc_usb_clk);
++ }
++ clk_disable(mxc_ahb_clk);
++ clk_put(mxc_ahb_clk);
++}
+diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
+new file mode 100644
+index 0000000..42a74b8
+--- /dev/null
++++ b/drivers/usb/gadget/fsl_udc_core.c
+@@ -0,0 +1,2491 @@
++/*
++ * Copyright (C) 2004-2007 Freescale Semicondutor, Inc. All rights reserved.
++ *
++ * Author: Li Yang <le...@fr...>
++ * Jiang Bo <tan...@fr...>
++ *
++ * Description:
++ * Freescale high-speed USB SOC DR module device controller driver.
++ * This can be found on MPC8349E/MPC8313E cpus.
++ * The driver is previously named as mpc_udc. Based on bare board
++ * code from Dave Liu and Shlomi Gridish.
++ *
++ * 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.
++ */
++
++#undef VERBOSE
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/ioport.h>
++#include <linux/types.h>
++#include <linux/errno.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/interrupt.h>
++#include <linux/proc_fs.h>
++#include <linux/mm.h>
++#include <linux/moduleparam.h>
++#include <linux/device.h>
++#include <linux/usb/ch9.h>
++#include <linux/usb/gadget.h>
++#include <linux/usb/otg.h>
++#include <linux/dma-mapping.h>
++#include <linux/platform_device.h>
++#include <linux/fsl_devices.h>
++#include <linux/dmapool.h>
++#include <linux/delay.h>
++
++#include <asm/byteorder.h>
++#include <asm/io.h>
++#include <asm/system.h>
++#include <asm/unaligned.h>
++#include <asm/dma.h>
++
++#include "fsl_usb2_udc.h"
++
++#define DRIVER_DESC "Freescale High-Speed USB SOC Device Controller driver"
++#define DRIVER_AUTHOR "Li Yang/Jiang Bo"
++#define DRIVER_VERSION "Apr 20, 2007"
++
++#define DMA_ADDR_INVALID (~(dma_addr_t)0)
++
++static const char driver_name[] = "fsl-usb2-udc";
++static const char driver_desc[] = DRIVER_DESC;
++
++static struct usb_dr_device *dr_regs;
++#ifndef CONFIG_ARCH_MXC
++static struct usb_sys_interface *usb_sys_regs;
++#endif
++
++/* it is initialized in probe() */
++static struct fsl_udc *udc_controller = NULL;
++
++static const struct usb_endpoint_descriptor
++fsl_ep0_desc = {
++ .bLength = USB_DT_ENDPOINT_SIZE,
++ .bDescriptorType = USB_DT_ENDPOINT,
++ .bEndpointAddress = 0,
++ .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
++ .wMaxPacketSize = USB_MAX_CTRL_PAYLOAD,
++};
++
++static void fsl_ep_fifo_flush(struct usb_ep *_ep);
++
++#ifdef CONFIG_PPC32
++#define fsl_readl(addr) in_le32(addr)
++#define fsl_writel(val32, addr) out_le32(addr, val32)
++#else
++#define fsl_readl(addr) readl(addr)
++#define fsl_writel(val32, addr) writel(val32, addr)
++#endif
++
++/********************************************************************
++ * Internal Used Function
++********************************************************************/
++/*-----------------------------------------------------------------
++ * done() - retire a request; caller blocked irqs
++ * @status : request status to be set, only works when
++ * request is still in progress.
++ *--------------------------------------------------------------*/
++static void done(struct fsl_ep *ep, struct fsl_req *req, int status)
++{
++ struct fsl_udc *udc = NULL;
++ unsigned char stopped = ep->stopped;
++ struct ep_td_struct *curr_td, *next_td;
++ int j;
++
++ udc = (struct fsl_udc *)ep->udc;
++ /* Removed the req from fsl_ep->queue */
++ list_del_init(&req->queue);
++
++ /* req.status should be set as -EINPROGRESS in ep_queue() */
++ if (req->req.status == -EINPROGRESS)
++ req->req.status = status;
++ else
++ status = req->req.status;
++
++ /* Free dtd for the request */
++ next_td = req->head;
++ for (j = 0; j < req->dtd_count; j++) {
++ curr_td = next_td;
++ if (j != req->dtd_count - 1) {
++ next_td = curr_td->next_td_virt;
++ }
++ dma_pool_free(udc->td_pool, curr_td, curr_td->td_dma);
++ }
++
++ if (req->mapped) {
++ dma_unmap_single(ep->udc->gadget.dev.parent,
++ req->req.dma, req->req.length,
++ ep_is_in(ep)
++ ? DMA_TO_DEVICE
++ : DMA_FROM_DEVICE);
++ req->req.dma = DMA_ADDR_INVALID;
++ req->mapped = 0;
++ } else
++ dma_sync_single_for_cpu(ep->udc->gadget.dev.parent,
++ req->req.dma, req->req.length,
++ ep_is_in(ep)
++ ? DMA_TO_DEVICE
++ : DMA_FROM_DEVICE);
++
++ if (status && (status != -ESHUTDOWN))
++ VDBG("complete %s req %p stat %d len %u/%u",
++ ep->ep.name, &req->req, status,
++ req->req.actual, req->req.length);
++
++ ep->stopped = 1;
++
++ spin_unlock(&ep->udc->lock);
++ /* complete() is from gadget layer,
++ * eg fsg->bulk_in_complete() */
++ if (req->req.complete)
++ req->req.complete(&ep->ep, &req->req);
++
++ spin_lock(&ep->udc->lock);
++ ep->stopped = stopped;
++}
++
++/*-----------------------------------------------------------------
++ * nuke(): delete all requests related to this ep
++ * called with spinlock held
++ *--------------------------------------------------------------*/
++static void nuke(struct fsl_ep *ep, int status)
++{
++ ep->stopped = 1;
++
++ /* Flush fifo */
++ fsl_ep_fifo_flush(&ep->ep);
++
++ /* Whether this eq has request linked */
++ while (!list_empty(&ep->queue)) {
++ struct fsl_req *req = NULL;
++
++ req = list_entry(ep->queue.next, struct fsl_req, queue);
++ done(ep, req, status);
++ }
++}
++
++/*------------------------------------------------------------------
++ Internal Hardware related function
++ ------------------------------------------------------------------*/
++
++static int dr_controller_setup(struct fsl_udc *udc)
++{
++ unsigned int tmp, portctrl;
++#ifndef CONFIG_ARCH_MXC
++ unsigned int ctrl;
++#endif
++ unsigned long timeout;
++#define FSL_UDC_RESET_TIMEOUT 1000
++
++ /* Config PHY interface */
++ portctrl = fsl_readl(&dr_regs->portsc1);
++ portctrl &= ~(PORTSCX_PHY_TYPE_SEL | PORTSCX_PORT_WIDTH);
++ switch (udc->phy_mode) {
++ case FSL_USB2_PHY_ULPI:
++ portctrl |= PORTSCX_PTS_ULPI;
++ break;
++ case FSL_USB2_PHY_UTMI_WIDE:
++ portctrl |= PORTSCX_PTW_16BIT;
++ /* fall through */
++ case FSL_USB2_PHY_UTMI:
++ portctrl |= PORTSCX_PTS_UTMI;
++ break;
++ case FSL_USB2_PHY_SERIAL:
++ portctrl |= PORTSCX_PTS_FSLS;
++ break;
++ default:
++ return -EINVAL;
++ }
++ fsl_writel(portctrl, &dr_regs->portsc1);
++
++ /* Stop and reset the usb controller */
++ tmp = fsl_readl(&dr_regs->usbcmd);
++ tmp &= ~USB_CMD_RUN_STOP;
++ fsl_writel(tmp, &dr_regs->usbcmd);
++
++ tmp = fsl_readl(&dr_regs->usbcmd);
++ tmp |= USB_CMD_CTRL_RESET;
++ fsl_writel(tmp, &dr_regs->usbcmd);
++
++ /* Wait for reset to complete */
++ timeout = jiffies + FSL_UDC_RESET_TIMEOUT;
++ while (fsl_readl(&dr_regs->usbcmd) & USB_CMD_CTRL_RESET) {
++ if (time_after(jiffies, timeout)) {
++ ERR("udc reset timeout!\n");
++ return -ETIMEDOUT;
++ }
++ cpu_relax();
++ }
++
++ /* Set the controller as device mode */
++ tmp = fsl_readl(&dr_regs->usbmode);
++ tmp |= USB_MODE_CTRL_MODE_DEVICE;
++ /* Disable Setup Lockout */
++ tmp |= USB_MODE_SETUP_LOCK_OFF;
++ fsl_writel(tmp, &dr_regs->usbmode);
++
++ /* Clear the setup status */
++ fsl_writel(0, &dr_regs->usbsts);
++
++ tmp = udc->ep_qh_dma;
++ tmp &= USB_EP_LIST_ADDRESS_MASK;
++ fsl_writel(tmp, &dr_regs->endpointlistaddr);
++
++ VDBG("vir[qh_base] is %p phy[qh_base] is 0x%8x reg is 0x%8x",
++ udc->ep_qh, (int)tmp,
++ fsl_readl(&dr_regs->endpointlistaddr));
++
++ /* Config control enable i/o output, cpu endian register */
++#ifndef CONFIG_ARCH_MXC
++ ctrl = __raw_readl(&usb_sys_regs->control);
++ ctrl |= USB_CTRL_IOENB;
++ __raw_writel(ctrl, &usb_sys_regs->control);
++#endif
++
++#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
++ /* Turn on cache snooping hardware, since some PowerPC platforms
++ * wholly rely on hardware to deal with cache coherent. */
++
++ /* Setup Snooping for all the 4GB space */
++ tmp = SNOOP_SIZE_2GB; /* starts from 0x0, size 2G */
++ __raw_writel(tmp, &usb_sys_regs->snoop1);
++ tmp |= 0x80000000; /* starts from 0x8000000, size 2G */
++ __raw_writel(tmp, &usb_sys_regs->snoop2);
++#endif
++
++ return 0;
++}
++
++/* Enable DR irq and set controller to run state */
++static void dr_controller_run(struct fsl_udc *udc)
++{
++ u32 temp;
++
++ /* Enable DR irq reg */
++ temp = USB_INTR_INT_EN | USB_INTR_ERR_INT_EN
++ | USB_INTR_PTC_DETECT_EN | USB_INTR_RESET_EN
++ | USB_INTR_DEVICE_SUSPEND | USB_INTR_SYS_ERR_EN;
++
++ fsl_writel(temp, &dr_regs->usbintr);
++
++ /* Clear stopped bit */
++ udc->stopped = 0;
++
++ /* Set the controller as device mode */
++ temp = fsl_readl(&dr_regs->usbmode);
++ temp |= USB_MODE_CTRL_MODE_DEVICE;
++ fsl_writel(temp, &dr_regs->usbmode);
++
++ /* Set controller to Run */
++ temp = fsl_readl(&dr_regs->usbcmd);
++ temp |= USB_CMD_RUN_STOP;
++ fsl_writel(temp, &dr_regs->usbcmd);
++
++ return;
++}
++
++static void dr_controller_stop(struct fsl_udc *udc)
++{
++ unsigned int tmp;
++
++ /* disable all INTR */
++ fsl_writel(0, &dr_regs->usbintr);
++
++ /* Set stopped bit for isr */
++ udc->stopped = 1;
++
++ /* disable IO output */
++/* usb_sys_regs->control = 0; */
++
++ /* set controller to Stop */
++ tmp = fsl_readl(&dr_regs->usbcmd);
++ tmp &= ~USB_CMD_RUN_STOP;
++ fsl_writel(tmp, &dr_regs->usbcmd);
++
++ return;
++}
++
++static void dr_ep_setup(unsigned char ep_num, unsigned char dir,
++ unsigned char ep_type)
++{
++ unsigned int tmp_epctrl = 0;
++
++ tmp_epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++ if (dir) {
++ if (ep_num)
++ tmp_epctrl |= EPCTRL_TX_DATA_TOGGLE_RST;
++ tmp_epctrl |= EPCTRL_TX_ENABLE;
++ tmp_epctrl |= ((unsigned int)(ep_type)
++ << EPCTRL_TX_EP_TYPE_SHIFT);
++ } else {
++ if (ep_num)
++ tmp_epctrl |= EPCTRL_RX_DATA_TOGGLE_RST;
++ tmp_epctrl |= EPCTRL_RX_ENABLE;
++ tmp_epctrl |= ((unsigned int)(ep_type)
++ << EPCTRL_RX_EP_TYPE_SHIFT);
++ }
++
++ fsl_writel(tmp_epctrl, &dr_regs->endptctrl[ep_num]);
++}
++
++static void
++dr_ep_change_stall(unsigned char ep_num, unsigned char dir, int value)
++{
++ u32 tmp_epctrl = 0;
++
++ tmp_epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++
++ if (value) {
++ /* set the stall bit */
++ if (dir)
++ tmp_epctrl |= EPCTRL_TX_EP_STALL;
++ else
++ tmp_epctrl |= EPCTRL_RX_EP_STALL;
++ } else {
++ /* clear the stall bit and reset data toggle */
++ if (dir) {
++ tmp_epctrl &= ~EPCTRL_TX_EP_STALL;
++ tmp_epctrl |= EPCTRL_TX_DATA_TOGGLE_RST;
++ } else {
++ tmp_epctrl &= ~EPCTRL_RX_EP_STALL;
++ tmp_epctrl |= EPCTRL_RX_DATA_TOGGLE_RST;
++ }
++ }
++ fsl_writel(tmp_epctrl, &dr_regs->endptctrl[ep_num]);
++}
++
++/* Get stall status of a specific ep
++ Return: 0: not stalled; 1:stalled */
++static int dr_ep_get_stall(unsigned char ep_num, unsigned char dir)
++{
++ u32 epctrl;
++
++ epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++ if (dir)
++ return (epctrl & EPCTRL_TX_EP_STALL) ? 1 : 0;
++ else
++ return (epctrl & EPCTRL_RX_EP_STALL) ? 1 : 0;
++}
++
++/********************************************************************
++ Internal Structure Build up functions
++********************************************************************/
++
++/*------------------------------------------------------------------
++* struct_ep_qh_setup(): set the Endpoint Capabilites field of QH
++ * @zlt: Zero Length Termination Select (1: disable; 0: enable)
++ * @mult: Mult field
++ ------------------------------------------------------------------*/
++static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num,
++ unsigned char dir, unsigned char ep_type,
++ unsigned int max_pkt_len,
++ unsigned int zlt, unsigned char mult)
++{
++ struct ep_queue_head *p_QH = &udc->ep_qh[2 * ep_num + dir];
++ unsigned int tmp = 0;
++
++ /* set the Endpoint Capabilites in QH */
++ switch (ep_type) {
++ case USB_ENDPOINT_XFER_CONTROL:
++ /* Interrupt On Setup (IOS). for control ep */
++ tmp = (max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS)
++ | EP_QUEUE_HEAD_IOS;
++ break;
++ case USB_ENDPOINT_XFER_ISOC:
++ tmp = (max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS)
++ | (mult << EP_QUEUE_HEAD_MULT_POS);
++ break;
++ case USB_ENDPOINT_XFER_BULK:
++ case USB_ENDPOINT_XFER_INT:
++ tmp = max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS;
++ break;
++ default:
++ VDBG("error ep type is %d", ep_type);
++ return;
++ }
++ if (zlt)
++ tmp |= EP_QUEUE_HEAD_ZLT_SEL;
++
++ p_QH->max_pkt_length = cpu_to_le32(tmp);
++ p_QH->next_dtd_ptr = 1;
++ p_QH->size_ioc_int_sts = 0;
++
++ return;
++}
++
++/* Setup qh structure and ep register for ep0. */
++static void ep0_setup(struct fsl_udc *udc)
++{
++ /* the intialization of an ep includes: fields in QH, Regs,
++ * fsl_ep struct */
++ struct_ep_qh_setup(udc, 0, USB_RECV, USB_ENDPOINT_XFER_CONTROL,
++ USB_MAX_CTRL_PAYLOAD, 0, 0);
++ struct_ep_qh_setup(udc, 0, USB_SEND, USB_ENDPOINT_XFER_CONTROL,
++ USB_MAX_CTRL_PAYLOAD, 0, 0);
++ dr_ep_setup(0, USB_RECV, USB_ENDPOINT_XFER_CONTROL);
++ dr_ep_setup(0, USB_SEND, USB_ENDPOINT_XFER_CONTROL);
++
++ return;
++
++}
++
++/***********************************************************************
++ Endpoint Management Functions
++***********************************************************************/
++
++/*-------------------------------------------------------------------------
++ * when configurations are set, or when interface settings change
++ * for example the do_set_interface() in gadget layer,
++ * the driver will enable or disable the relevant endpoints
++ * ep0 doesn't use this routine. It is always enabled.
++-------------------------------------------------------------------------*/
++static int fsl_ep_enable(struct usb_ep *_ep,
++ const struct usb_endpoint_descriptor *desc)
++{
++ struct fsl_udc *udc = NULL;
++ struct fsl_ep *ep = NULL;
++ unsigned short max = 0;
++ unsigned char mult = 0, zlt;
++ int retval = -EINVAL;
++ unsigned long flags = 0;
++
++ ep = container_of(_ep, struct fsl_ep, ep);
++
++ /* catch various bogus parameters */
++ if (!_ep || !desc || ep->desc
++ || (desc->bDescriptorType != USB_DT_ENDPOINT))
++ return -EINVAL;
++
++ udc = ep->udc;
++
++ if (!udc->driver || (udc->gadget.speed == USB_SPEED_UNKNOWN))
++ return -ESHUTDOWN;
++
++ max = le16_to_cpu(desc->wMaxPacketSize);
++
++ /* Disable automatic zlp generation. Driver is reponsible to indicate
++ * explicitly through req->req.zero. This is needed to enable multi-td
++ * request. */
++ zlt = 1;
++
++ /* Assume the max packet size from gadget is always correct */
++ switch (desc->bmAttributes & 0x03) {
++ case USB_ENDPOINT_XFER_CONTROL:
++ case USB_ENDPOINT_XFER_BULK:
++ case USB_ENDPOINT_XFER_INT:
++ /* mult = 0. Execute N Transactions as demonstrated by
++ * the USB variable length packet protocol where N is
++ * computed using the Maximum Packet Length (dQH) and
++ * the Total Bytes field (dTD) */
++ mult = 0;
++ break;
++ case USB_ENDPOINT_XFER_ISOC:
++ /* Calculate transactions needed for high bandwidth iso */
++ mult = (unsigned char)(1 + ((max >> 11) & 0x03));
++ max = max & 0x8ff; /* bit 0~10 */
++ /* 3 transactions at most */
++ if (mult > 3)
++ goto en_done;
++ break;
++ default:
++ goto en_done;
++ }
++
++ spin_lock_irqsave(&udc->lock, flags);
++ ep->ep.maxpacket = max;
++ ep->desc = desc;
++ ep->stopped = 0;
++
++ /* Controller related setup */
++ /* Init EPx Queue Head (Ep Capabilites field in QH
++ * according to max, zlt, mult) */
++ struct_ep_qh_setup(udc, (unsigned char) ep_index(ep),
++ (unsigned char) ((desc->bEndpointAddress & USB_DIR_IN)
++ ? USB_SEND : USB_RECV),
++ (unsigned char) (desc->bmAttributes
++ & USB_ENDPOINT_XFERTYPE_MASK),
++ max, zlt, mult);
++
++ /* Init endpoint ctrl register */
++ dr_ep_setup((unsigned char) ep_index(ep),
++ (unsigned char) ((desc->bEndpointAddress & USB_DIR_IN)
++ ? USB_SEND : USB_RECV),
++ (unsigned char) (desc->bmAttributes
++ & USB_ENDPOINT_XFERTYPE_MASK));
++
++ spin_unlock_irqrestore(&udc->lock, flags);
++ retval = 0;
++
++ VDBG("enabled %s (ep%d%s) maxpacket %d",ep->ep.name,
++ ep->desc->bEndpointAddress & 0x0f,
++ (desc->bEndpointAddress & USB_DIR_IN)
++ ? "in" : "out", max);
++en_done:
++ return retval;
++}
++
++/*---------------------------------------------------------------------
++ * @ep : the ep being unconfigured. May not be ep0
++ * Any pending and uncomplete req will complete with status (-ESHUTDOWN)
++*---------------------------------------------------------------------*/
++static int fsl_ep_disable(struct usb_ep *_ep)
++{
++ struct fsl_udc *udc = NULL;
++ struct fsl_ep *ep = NULL;
++ unsigned long flags = 0;
++ u32 epctrl;
++ int ep_num;
++
++ ep = container_of(_ep, struct fsl_ep, ep);
++ if (!_ep || !ep->desc) {
++ VDBG("%s not enabled", _ep ? ep->ep.name : NULL);
++ return -EINVAL;
++ }
++
++ /* disable ep on controller */
++ ep_num = ep_index(ep);
++ epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++ if (ep_is_in(ep))
++ epctrl &= ~EPCTRL_TX_ENABLE;
++ else
++ epctrl &= ~EPCTRL_RX_ENABLE;
++ fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
++
++ udc = (struct fsl_udc *)ep->udc;
++ spin_lock_irqsave(&udc->lock, flags);
++
++ /* nuke all pending requests (does flush) */
++ nuke(ep, -ESHUTDOWN);
++
++ ep->desc = NULL;
++ ep->stopped = 1;
++ spin_unlock_irqrestore(&udc->lock, flags);
++
++ VDBG("disabled %s OK", _ep->name);
++ return 0;
++}
++
++/*---------------------------------------------------------------------
++ * allocate a request object used by this endpoint
++ * the main operation is to insert the req->queue to the eq->queue
++ * Returns the request, or null if one could not be allocated
++*---------------------------------------------------------------------*/
++static struct usb_request *
++fsl_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
++{
++ struct fsl_req *req = NULL;
++
++ req = kzalloc(sizeof *req, gfp_flags);
++ if (!req)
++ return NULL;
++
++ req->req.dma = DMA_ADDR_INVALID;
++ INIT_LIST_HEAD(&req->queue);
++
++ return &req->req;
++}
++
++static void fsl_free_request(struct usb_ep *_ep, struct usb_request *_req)
++{
++ struct fsl_req *req = NULL;
++
++ req = container_of(_req, struct fsl_req, req);
++
++ if (_req)
++ kfree(req);
++}
++
++/*-------------------------------------------------------------------------*/
++static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
++{
++ int i = ep_index(ep) * 2 + ep_is_in(ep);
++ u32 temp, bitmask, tmp_stat;
++ struct ep_queue_head *dQH = &ep->udc->ep_qh[i];
++
++ /* VDBG("QH addr Register 0x%8x", dr_regs->endpointlistaddr);
++ VDBG("ep_qh[%d] addr is 0x%8x", i, (u32)&(ep->udc->ep_qh[i])); */
++
++ bitmask = ep_is_in(ep)
++ ? (1 << (ep_index(ep) + 16))
++ : (1 << (ep_index(ep)));
++
++ /* check if the pipe is empty */
++ if (!(list_empty(&ep->queue))) {
++ /* Add td to the end */
++ struct fsl_req *lastreq;
++ lastreq = list_entry(ep->queue.prev, struct fsl_req, queue);
++ lastreq->tail->next_td_ptr =
++ cpu_to_le32(req->head->td_dma & DTD_ADDR_MASK);
++ /* Read prime bit, if 1 goto done */
++ if (fsl_readl(&dr_regs->endpointprime) & bitmask)
++ goto out;
++
++ do {
++ /* Set ATDTW bit in USBCMD */
++ temp = fsl_readl(&dr_regs->usbcmd);
++ fsl_writel(temp | USB_CMD_ATDTW, &dr_regs->usbcmd);
++
++ /* Read correct status bit */
++ tmp_stat = fsl_readl(&dr_regs->endptstatus) & bitmask;
++
++ } while (!(fsl_readl(&dr_regs->usbcmd) & USB_CMD_ATDTW));
++
++ /* Write ATDTW bit to 0 */
++ temp = fsl_readl(&dr_regs->usbcmd);
++ fsl_writel(temp & ~USB_CMD_ATDTW, &dr_regs->usbcmd);
++
++ if (tmp_stat)
++ goto out;
++ }
++
++ /* Write dQH next pointer and terminate bit to 0 */
++ temp = req->head->td_dma & EP_QUEUE_HEAD_NEXT_POINTER_MASK;
++ dQH->next_dtd_ptr = cpu_to_le32(temp);
++
++ /* Clear active and halt bit */
++ temp = cpu_to_le32(~(EP_QUEUE_HEAD_STATUS_ACTIVE
++ | EP_QUEUE_HEAD_STATUS_HALT));
++ dQH->size_ioc_int_sts &= temp;
++
++ /* Ensure that updates to the QH will occure before priming. */
++ wmb();
++
++ /* Prime endpoint by writing 1 to ENDPTPRIME */
++ temp = ep_is_in(ep)
++ ? (1 << (ep_index(ep) + 16))
++ : (1 << (ep_index(ep)));
++ fsl_writel(temp, &dr_regs->endpointprime);
++out:
++ return;
++}
++
++/* Fill in the dTD structure
++ * @req: request that the transfer belongs to
++ * @length: return actually data length of the dTD
++ * @dma: return dma address of the dTD
++ * @is_last: return flag if it is the last dTD of the request
++ * return: pointer to the built dTD */
++static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
++ dma_addr_t *dma, int *is_last)
++{
++ u32 swap_temp;
++ struct ep_td_struct *dtd;
++
++ /* how big will this transfer be? */
++ *length = min(req->req.length - req->req.actual,
++ (unsigned)EP_MAX_LENGTH_TRANSFER);
++
++ dtd = dma_pool_alloc(udc_controller->td_pool, GFP_KERNEL, dma);
++ if (dtd == NULL)
++ return dtd;
++
++ dtd->td_dma = *dma;
++ /* Clear reserved field */
++ swap_temp = cpu_to_le32(dtd->size_ioc_sts);
++ swap_temp &= ~DTD_RESERVED_FIELDS;
++ dtd->size_ioc_sts = cpu_to_le32(swap_temp);
++
++ /* Init all of buffer page pointers */
++ swap_temp = (u32) (req->req.dma + req->req.actual);
++ dtd->buff_ptr0 = cpu_to_le32(swap_temp);
++ dtd->buff_ptr1 = cpu_to_le32(swap_temp + 0x1000);
++ dtd->buff_ptr2 = cpu_to_le32(swap_temp + 0x2000);
++ dtd->buff_ptr3 = cpu_to_le32(swap_temp + 0x3000);
++ dtd->buff_ptr4 = cpu_to_le32(swap_temp + 0x4000);
++
++ req->req.actual += *length;
++
++ /* zlp is needed if req->req.zero is set */
++ if (req->req.zero) {
++ if (*length == 0 || (*length % req->ep->ep.maxpacket) != 0)
++ *is_last = 1;
++ else
++ *is_last = 0;
++ } else if (req->req.length == req->req.actual)
++ *is_last = 1;
++ else
++ *is_last = 0;
++
++ if ((*is_last) == 0)
++ VDBG("multi-dtd request!");
++ /* Fill in the transfer size; set active bit */
++ swap_temp = ((*length << DTD_LENGTH_BIT_POS) | DTD_STATUS_ACTIVE);
++
++ /* Enable interrupt for the last dtd of a request */
++ if (*is_last && !req->req.no_interrupt)
++ swap_temp |= DTD_IOC;
++
++ dtd->size_ioc_sts = cpu_to_le32(swap_temp);
++
++ mb();
++
++ VDBG("length = %d address= 0x%x", *length, (int)*dma);
++
++ return dtd;
++}
++
++/* Generate dtd chain for a request */
++static int fsl_req_to_dtd(struct fsl_req *req)
++{
++ unsigned count;
++ int is_last;
++ int is_first =1;
++ struct ep_td_struct *last_dtd = NULL, *dtd;
++ dma_addr_t dma;
++
++ do {
++ dtd = fsl_build_dtd(req, &count, &dma, &is_last);
++ if (dtd == NULL)
++ return -ENOMEM;
++
++ if (is_first) {
++ is_first = 0;
++ req->head = dtd;
++ } else {
++ last_dtd->next_td_ptr = cpu_to_le32(dma);
++ last_dtd->next_td_virt = dtd;
++ }
++ last_dtd = dtd;
++
++ req->dtd_count++;
++ } while (!is_last);
++
++ dtd->next_td_ptr = cpu_to_le32(DTD_NEXT_TERMINATE);
++
++ req->tail = dtd;
++
++ return 0;
++}
++
++/* queues (submits) an I/O request to an endpoint */
++static int
++fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
++{
++ struct fsl_ep *ep = container_of(_ep, struct fsl_ep, ep);
++ struct fsl_req *req = container_of(_req, struct fsl_req, req);
++ struct fsl_udc *udc;
++ unsigned long flags;
++ int is_iso = 0;
++
++ /* catch various bogus parameters */
++ if (!_req || !req->req.complete || !req->req.buf
++ || !list_empty(&req->queue)) {
++ VDBG("%s, bad params", __func__);
++ return -EINVAL;
++ }
++ if (unlikely(!_ep || !ep->desc)) {
++ VDBG("%s, bad ep", __func__);
++ return -EINVAL;
++ }
++ if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
++ if (req->req.length > ep->ep.maxpacket)
++ return -EMSGSIZE;
++ is_iso = 1;
++ }
++
++ udc = ep->udc;
++ if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN)
++ return -ESHUTDOWN;
++
++ req->ep = ep;
++
++ /* map virtual address to hardware */
++ if (req->req.dma == DMA_ADDR_INVALID) {
++ req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
++ req->req.buf,
++ req->req.length, ep_is_in(ep)
++ ? DMA_TO_DEVICE
++ : DMA_FROM_DEVICE);
++ req->mapped = 1;
++ } else {
++ dma_sync_single_for_device(ep->udc->gadget.dev.parent,
++ req->req.dma, req->req.length,
++ ep_is_in(ep)
++ ? DMA_TO_DEVICE
++ : DMA_FROM_DEVICE);
++ req->mapped = 0;
++ }
++
++ req->req.status = -EINPROGRESS;
++ req->req.actual = 0;
++ req->dtd_count = 0;
++
++ spin_lock_irqsave(&udc->lock, flags);
++
++ /* build dtds and push them to device queue */
++ if (!fsl_req_to_dtd(req)) {
++ fsl_queue_td(ep, req);
++ } else {
++ spin_unlock_irqrestore(&udc->lock, flags);
++ return -ENOMEM;
++ }
++
++ /* Update ep0 state */
++ if ((ep_index(ep) == 0))
++ udc->ep0_state = DATA_STATE_XMIT;
++
++ /* irq handler advances the queue */
++ if (req != NULL)
++ list_add_tail(&req->queue, &ep->queue);
++ spin_unlock_irqrestore(&udc->lock, flags);
++
++ return 0;
++}
++
++/* dequeues (cancels, unlinks) an I/O request from an endpoint */
++static int fsl_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
++{
++ struct fsl_ep *ep = container_of(_ep, struct fsl_ep, ep);
++ struct fsl_req *req;
++ unsigned long flags;
++ int ep_num, stopped, ret = 0;
++ u32 epctrl;
++
++ if (!_ep || !_req)
++ return -EINVAL;
++
++ spin_lock_irqsave(&ep->udc->lock, flags);
++ stopped = ep->stopped;
++
++ /* Stop the ep before we deal with the queue */
++ ep->stopped = 1;
++ ep_num = ep_index(ep);
++ epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++ if (ep_is_in(ep))
++ epctrl &= ~EPCTRL_TX_ENABLE;
++ else
++ epctrl &= ~EPCTRL_RX_ENABLE;
++ fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
++
++ /* make sure it's actually queued on this endpoint */
++ list_for_each_entry(req, &ep->queue, queue) {
++ if (&req->req == _req)
++ break;
++ }
++ if (&req->req != _req) {
++ ret = -EINVAL;
++ goto out;
++ }
++
++ /* The request is in progress, or completed but not dequeued */
++ if (ep->queue.next == &req->queue) {
++ _req->status = -ECONNRESET;
++ fsl_ep_fifo_flush(_ep); /* flush current transfer */
++
++ /* The request isn't the last request in this ep queue */
++ if (req->queue.next != &ep->queue) {
++ struct ep_queue_head *qh;
++ struct fsl_req *next_req;
++
++ qh = ep->qh;
++ next_req = list_entry(req->queue.next, struct fsl_req,
++ queue);
++
++ /* Point the QH to the first TD of next request */
++ fsl_writel((u32) next_req->head, &qh->curr_dtd_ptr);
++ }
++
++ /* The request hasn't been processed, patch up the TD chain */
++ } else {
++ struct fsl_req *prev_req;
++
++ prev_req = list_entry(req->queue.prev, struct fsl_req, queue);
++ fsl_writel(fsl_readl(&req->tail->next_td_ptr),
++ &prev_req->tail->next_td_ptr);
++
++ }
++
++ done(ep, req, -ECONNRESET);
++
++ /* Enable EP */
++out: epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
++ if (ep_is_in(ep))
++ epctrl |= EPCTRL_TX_ENABLE;
++ else
++ epctrl |= EPCTRL_RX_ENABLE;
++ fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
++ ep->stopped = stopped;
++
++ spin_unlock_irqrestore(&ep->udc->lock, flags);
++ return ret;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/*-----------------------------------------------------------------
++ * modify the endpoint halt feature
++ * @ep: the non-isochronous endpoint being stalled
++ * @value: 1--set halt 0--clear halt
++ * Returns zero, or a negative error code.
++*----------------------------------------------------------------*/
++static int fsl_ep_set_halt(struct usb_ep *_ep, int value)
++{
++ struct fsl_ep *ep = NULL;
++ unsigned long flags = 0;
++ int status = -EOPNOTSUPP; /* operation not supported */
++ unsigned char ep_dir = 0, ep_num = 0;
++ struct fsl_udc *udc = NULL;
++
++ ep = container_of(_ep, struct fsl_ep, ep);
++ udc = ep->udc;
++ if (!_ep || !ep->desc) {
++ status = -EINVAL;
++ goto out;
++ }
++
++ if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
++ status = -EOPNOTSUPP;
++ goto out;
++ }
++
++ /* Attempt to halt IN ep will fail if any transfer requests
++ * are still queue */
++ if (value && ep_is_in(ep) && !list_empty(&ep->queue)) {
++ status = -EAGAIN;
++ goto out;
++ }
++
++ status = 0;
++ ep_dir = ep_is_in(ep) ? USB_SEND : USB_RECV;
++ ep_num = (unsigned char)(ep_index(ep));
++ spin_lock_irqsave(&ep->udc->lock, flags);
++ dr_ep_change_stall(ep_num, ep_dir, value);
++ spin_unlock_irqrestore(&ep->udc->lock, flags);
++
++ if (ep_index(ep) == 0) {
++ udc->ep0_state = WAIT_FOR_SETUP;
++ udc->ep0_dir = 0;
++ }
++out:
++ VDBG(" %s %s halt stat %d", ep->ep.name,
++ value ? "set" : "clear", status);
++
++ return status;
++}
++
++static void fsl_ep_fifo_flush(struct usb_ep *_ep)
++{
++ struct fsl_ep *ep;
++ int ep_num, ep_dir;
++ u32 bits;
++ unsigned long timeout;
++#define FSL_UDC_FLUSH_TIMEOUT 1000
++
++ if (!_ep) {
++ return;
++ } else {
++ ep = container_of(_ep, struct fsl_ep, ep);
++ if (!ep->desc)
++ return;
++ }
++ ep_num = ep_index(ep);
++ ep_dir = ep_is_in(ep) ? USB_SEND : USB_RECV;
++
++ if (ep_num == 0)
++ bits = (1 << 16) | 1;
++ else if (ep_dir == USB_SEND)
++ bits = 1 << (16 + ep_num);
++ else
++ bits = 1 << ep_num;
++
++ timeout = jiffies + FSL_UDC_FLUSH_TIMEOUT;
++ do {
++ fsl_writel(bits, &dr_regs->endptflush);
++
++ /* Wait until flush complete */
++ while (fsl_readl(&dr_regs->endptflush)) {
++ if (time_after(jiffies, timeout)) {
++ ERR("ep flush timeout\n");
++ return;
++ }
++ cpu_relax();
++ }
++ /* See if we need to flush again */
++ } while (fsl_readl(&dr_regs->endptstatus) & bits);
++}
++
++static struct usb_ep_ops fsl_ep_ops = {
++ .enable = fsl_ep_enable,
++ .disable = fsl_ep_disable,
++
++ .alloc_request = fsl_alloc_request,
++ .free_request = fsl_free_request,
++
++ .queue = fsl_ep_queue,
++ .dequeue = fsl_ep_dequeue,
++
++ .set_halt = fsl_ep_set_halt,
++ .fifo_flush = fsl_ep_fifo_flush, /* flush fifo */
++};
++
++/*-------------------------------------------------------------------------
++ Gadget Driver Layer Operations
++-------------------------------------------------------------------------*/
++
++/*----------------------------------------------------------------------
++ * Get the current frame number (from DR frame_index Reg )
++ *----------------------------------------------------------------------*/
++static int fsl_get_frame(struct usb_gadget *gadget)
++{
++ return (int)(fsl_readl(&dr_regs->frindex) & USB_FRINDEX_MASKS);
++}
++
++/*-----------------------------------------------------------------------
++ * Tries to wake up the host connected to this gadget
++ -----------------------------------------------------------------------*/
++static int fsl_wakeup(struct usb_gadget *gadget)
++{
++ struct fsl_udc *udc = container_of(gadget, struct fsl_udc, gadget);
++ u32 portsc;
++
++ /* Remote wakeup feature not enabled by host */
++ if (!udc->remote_wakeup)
++ return -ENOTSUPP;
++
++ portsc = fsl_readl(&dr_regs->portsc1);
++ /* not suspended? */
++ if (!(portsc & PORTSCX_PORT_SUSPEND))
++ return 0;
++ /* trigger force resume */
++ portsc |= PORTSCX_PORT_FORCE_RESUME;
++ fsl_writel(portsc, &dr_regs->portsc1);
++ return 0;
++}
++
++static int can_pullup(struct fsl_udc *udc)
++{
++ return udc->driver && udc->softconnect && udc->vbus_active;
++}
++
++/* Notify controller that VBUS is powered, Called by whatever
++ detects VBUS sessions */
++static int fsl_vbus_session(struct usb_gadget *gadget, int is_active)
++{
++ struct fsl_udc *udc;
++ unsigned long flags;
++
++ udc = container_of(gadget, struct fsl_udc, gadget);
++ spin_lock_irqsave(&udc->lock, flags);
++ VDBG("VBUS %s", is_active ? "on" : "off");
++ udc->vbus_active = (is_active != 0);
++ if (can_pullup(udc))
++ fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
++ &dr_regs->usbcmd);
++ else
++ fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP),
++ &dr_regs->usbcmd);
++ spin_unlock_irqrestore(&udc->lock, flags);
++ return 0;
++}
++
++/* constrain controller's VBUS power usage
++ * This call is used by gadget drivers during SET_CONFIGURATION calls,
++ * reporting how much power the device may consume. For example, this
++ * could affect how quickly batteries are recharged.
++ *
++ * Returns zero on success, else negative errno.
++ */
++static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA)
++{
++ struct fsl_udc *udc;
++
++ udc = container_of(gadget, struct fsl_udc, gadget);
++ if (udc->transceiver)
++ return otg_set_power(udc->transceiver, mA);
++ return -ENOTSUPP;
++}
++
++/* Change Data+ pullup status
++ * this func is used by usb_gadget_connect/disconnet
++ */
++static int fsl_pullup(struct usb_gadget *gadget, int is_on)
++{
++ struct fsl_udc *udc;
++
++ udc = container_of(gadget, struct fsl_udc, gadget);
++ udc->softconnect = (is_on != 0);
++ if (can_pullup(udc))
++ fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
++ &dr_regs->usbcmd);
++ else
++ fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP),
++ &dr_regs->usbcmd);
++
++ return 0;
++}
++
++/* defined in gadget.h */
++static struct usb_gadget_ops fsl_gadget_ops = {
++ .get_frame = fsl_get_frame,
++ .wakeup = fsl_wakeup,
++/* .set_selfpowered = fsl_set_selfpowered, */ /* Always selfpowered */
++ .vbus_session = fsl_vbus_session,
++ .vbus_draw = fsl_vbus_draw,
++ .pullup = fsl_pullup,
++};
++
++/* Set protocol stall on ep0, protocol stall will automatically be cleared
++ on new transaction */
++static void ep0stall(struct fsl_udc *udc)
++{
++ u32 tmp;
++
++ /* must set tx and rx to stall at the same time */
++ tmp = fsl_readl(&dr_regs->endptctrl[0]);
++ tmp |= EPCTRL_TX_EP_STALL | EPCTRL_RX_EP_STALL;
++ fsl_writel(tmp, &dr_regs->endptctrl[0]);
++ udc->ep0_state = WAIT_FOR_SETUP;
++ udc->ep0_dir = 0;
++}
++
++/* Prime a status phase for ep0 */
++static int ep0_prime_status(struct fsl_udc *udc, int direction)
++{
++ struct fsl_req *req = udc->status_req;
++ struct fsl_ep *ep;
++
++ if (direction == EP_DIR_IN)
++ udc->ep0_dir = USB_DIR_IN;
++ else
++ udc->ep0_dir = USB_DIR_OUT;
++
++ ep = &udc->eps[0];
++ udc->ep0_state = WAIT_FOR_OUT_STATUS;
++
++ req->ep = ep;
++ req->req.length = 0;
++ req->req.status = -EINPROGRESS;
++ req->req.actual = 0;
++ req->req.complete = NULL;
++ req->dtd_count = 0;
++
++ if (fsl_req_to_dtd(req) == 0)
++ fsl_queue_td(ep, req);
++ else
++ return -ENOMEM;
++
++ list_add_tail(&req->queue, &ep->queue);
++
++ return 0;
++}
++
++static void udc_reset_ep_queue(struct fsl_udc *udc, u8 pipe)
++{
++ struct fsl_ep *ep = get_ep_by_pipe(udc, pipe);
++
++ if (ep->name)
++ nuke(ep, -ESHUTDOWN);
++}
++
++/*
++ * ch9 Set address
++ */
++static void ch9setaddress(struct fsl_udc *udc, u16 value, u16 index, u16 length)
++{
++ /* Save the new address to device struct */
++ udc->device_address = (u8) value;
++ /* Update usb state */
++ udc->usb_state = USB_STATE_ADDRESS;
++ /* Status phase */
++ if (ep0_prime_status(udc, EP_DIR_IN))
++ ep0stall(udc);
++}
++
++/*
++ * ch9 Get status
++ */
++static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value,
++ u16 index, u16 length)
++{
++ u16 tmp = 0; /* Status, cpu endian */
++ struct fsl_req *req;
++ struct fsl_ep *ep;
++
++ ep = &udc->eps[0];
++
++ if ((request_type & USB_RECIP_MASK) == USB_RECIP_DEVICE) {
++ /* Get device status */
++ tmp = 1 << USB_DEVICE_SELF_POWERED;
++ tmp |= udc->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP;
++ } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_INTERFACE) {
++ /* Get interface status */
++ /* We don't have interface information in udc driver */
++ tmp = 0;
++ } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_ENDPOINT) {
++ /* Get endpoint status */
++ struct fsl_ep *target_ep;
++
++ target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index));
++
++ /* stall if endpoint doesn't exist */
++ if (!target_ep->desc)
++ goto stall;
++ tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep))
++ << USB_ENDPOINT_HALT;
++ }
++
++ udc->ep0_dir = USB_DIR_IN;
++ /* Borrow the per device status_req */
++ req = udc->status_req;
++ /* Fill in the reqest structure */
++ *((u16 *) req->req.buf) = cpu_to_le16(tmp);
++ req->ep = ep;
++ req->req.length = 2;
++ req->req.status = -EINPROGRESS;
++ req->req.actual = 0;
++ req->req.complete = NULL;
++ req->dtd_count = 0;
++
++ /* prime the data phase */
++ if ((fsl_req_to_dtd(req) == 0))
++ fsl_queue_td(ep, req);
++ else /* no mem */
++ goto stall;
++
++ list_add_tail(&req->queue, &ep->queue);
++ udc->ep0_state = DATA_STATE_XMIT;
++ return;
++stall:
++ ep0stall(udc);
++}
++
++static void setup_received_irq(struct fsl_udc *udc,
++ struct usb_ctrlrequest *setup)
++{
++ u16 wValue = le16_to_cpu(setup->wValue);
++ u16 wIndex = le16_to_cpu(setup->wIndex);
++ u16 wLength = le16_to_cpu(setup->wLength);
++
++ udc_reset_ep_queue(udc, 0);
++
++ /* We process some stardard setup requests here */
++ switch (setup->bRequest) {
++ case USB_REQ_GET_STATUS:
++ /* Data+Status phase from udc */
++ if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_MASK))
++ != (USB_DIR_IN | USB_TYPE_STANDARD))
++ break;
++ ch9getstatus(udc, setup->bRequestType, wValue, wIndex, wLength);
++ return;
++
++ case USB_REQ_SET_ADDRESS:
++ /* Status phase from udc */
++ if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD
++ | USB_RECIP_DEVICE))
++ break;
++ ch9setaddress(udc, wValue, wIndex, wLength);
++ return;
++
++ case USB_REQ_CLEAR_FEATURE:
++ case USB_REQ_SET_FEATURE:
++ /* Status phase from udc */
++ {
++ int rc = -EOPNOTSUPP;
++
++ if ((setup->bRequestType & (USB_RECIP_MASK | USB_TYPE_MASK))
++ == (USB_RECIP_ENDPOINT | USB_TYPE_STANDARD)) {
++ int pipe = get_pipe_by_windex(wIndex);
++ struct fsl_ep *ep;
++
++ if (wValue != 0 || wLength != 0 || pipe > udc->max_ep)
++ break;
++ ep = get_ep_by_pipe(udc, pipe);
++
++ spin_unlock(&udc->lock);
++ rc = fsl_ep_set_halt(&ep->ep,
++ (setup->bRequest == USB_REQ_SET_FEATURE)
++ ? 1 : 0);
++ spin_lock(&udc->lock);
++
++ } else if ((setup->bRequestType & (USB_RECIP_MASK
++ | USB_TYPE_MASK)) == (USB_RECIP_DEVICE
++ | USB_TYPE_STANDARD)) {
++ /* Note: The driver has not include OTG support yet.
++ * This will be set when OTG supp...
[truncated message content] |
|
From: Julien B a. A. <ar...@us...> - 2010-02-19 15:52:22
|
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 7466ac2121ad8cb5b150a0c3298568f848e90ec9 (commit)
via e5d0e054cc64861b7414ed0bef81608903cd93f1 (commit)
from 663489491607550291d1d6f795b74f6177786c56 (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 7466ac2121ad8cb5b150a0c3298568f848e90ec9
Merge: e5d0e054cc64861b7414ed0bef81608903cd93f1 663489491607550291d1d6f795b74f6177786c56
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 19 16:51:43 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit e5d0e054cc64861b7414ed0bef81608903cd93f1
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 19 16:51:22 2010 +0100
Indentation
-----------------------------------------------------------------------
Summary of changes:
target/linux/modules/display/hx5116_display.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/target/linux/modules/display/hx5116_display.c b/target/linux/modules/display/hx5116_display.c
index fd63d4c..22fe6fe 100644
--- a/target/linux/modules/display/hx5116_display.c
+++ b/target/linux/modules/display/hx5116_display.c
@@ -34,13 +34,13 @@ void hx5116_write(struct hx5116_display *hx5116_dev, u8 address, u16 data)
{
u8 command[2];
int ret;
+
/* Address */
command[0] = (address << 1) | HX5116_SPI_WRITE;
command[1] = data;
ret = spi_write(hx5116_dev->spi, command, 2);
if (ret < 0)
printk("ERROR: can't write on hx5116\n");
-
}
/* XXX: not functionnal, need half duplex capability under spi_gpio driver */
@@ -54,22 +54,26 @@ u8 hx5116_read(struct hx5116_display *hx5116_dev, u8 address)
ret = spi_w8r8(hx5116_dev->spi, command);
if (ret < 0)
printk("ERROR: can't read on hx5116\n");
+
return (u8)ret;
}
static int hx5116_display_get_contrast(struct display_device *dev)
{
struct hx5116_display *hx5116_dev = dev->priv_data;
+
/* TODO: read register value with spi_w8r8 */
+
return hx5116_dev->gcontrast_value;
}
-static int hx5116_display_set_contrast(struct display_device *dev, unsigned int value)
+static int hx5116_display_set_contrast(struct display_device *dev, unsigned int value)
{
struct hx5116_display *hx5116_dev = dev->priv_data;
hx5116_write(hx5116_dev, HX5116_RGB_CONTRAST, value);
hx5116_dev->gcontrast_value = value;
+
return value;
}
@@ -80,7 +84,6 @@ static int hx5116_display_probe(struct display_device *dev, void *data)
static int hx5116_display_remove(struct display_device *dev)
{
-
return 0;
}
@@ -153,16 +156,14 @@ static void hx5116_init_sequence(struct hx5116_display *hx5116_dev)
hx5116_write (hx5116_dev, 0x29, 0x04); /*set B_212*/
hx5116_write (hx5116_dev, 0x2A, 0x07); /*set B_255*/
hx5116_write (hx5116_dev, 0x06, 0x03); /*set display on*/
-
}
-
-
static int hx5116_spi_probe(struct spi_device *pdev)
{
int err = -EINVAL;
struct display_device *disp_dev;
struct hx5116_display *hx5116_dev = pdev->dev.platform_data;
+
/* fill hx5116 display structure */
disp_dev = display_device_register(&hx5116_ops,
&pdev->dev,
@@ -178,8 +179,7 @@ static int hx5116_spi_probe(struct spi_device *pdev)
hx5116_dev->spi->bits_per_word = 8;
hx5116_dev->spi->dev.power.power_state = PMSG_ON;
err = spi_setup(hx5116_dev->spi);
- if (err < 0)
- {
+ if (err < 0) {
goto spi_error;
}
@@ -201,6 +201,7 @@ static int hx5116_spi_remove(struct spi_device *pdev)
hx5116_dev->reset_on(1); /* let hx5116 in reset */
display_device_unregister(hx5116_dev->display_dev);
+
return 0;
}
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-02-18 10:35:45
|
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 663489491607550291d1d6f795b74f6177786c56 (commit)
via a7dec9e324e48ed00960f1d170ca182601f4d289 (commit)
from 1b1c16d8a95d2da379c26a736ba9865987a9e3ac (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 663489491607550291d1d6f795b74f6177786c56
Merge: a7dec9e324e48ed00960f1d170ca182601f4d289 1b1c16d8a95d2da379c26a736ba9865987a9e3ac
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 18 11:34:49 2010 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit a7dec9e324e48ed00960f1d170ca182601f4d289
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 18 11:33:41 2010 +0100
[DEBUG] imxregs: differentiates both ULPI viewports on i.MX27
-----------------------------------------------------------------------
Summary of changes:
target/linux/debug/imxregs/imx27regs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/linux/debug/imxregs/imx27regs.h b/target/linux/debug/imxregs/imx27regs.h
index c25d8c7..1361182 100644
--- a/target/linux/debug/imxregs/imx27regs.h
+++ b/target/linux/debug/imxregs/imx27regs.h
@@ -766,7 +766,7 @@ static struct reg_info regs[] =
{ "UOG_ASYNCLISTADDR", 0x10024158, 0, 0xffffffff, 'x', "Host Controller Next Asynch. Address" },
{ "UOG_BURSTSIZE", 0x10024160, 0, 0xffffffff, 'x', "Host Controller Embedded TT Asynch. Buffer" },
{ "UOG_TXFILLTUNING", 0x10024164, 0, 0xffffffff, 'x', "TX FIFO Fill Tuning (UOG_TXFILLTUNING)" },
-{ "ULPIVIEW", 0x10024170, 0, 0xffffffff, 'x', "ULPI Viewport (ULPIVIEW)" },
+{ "UOG_ULPIVIEW", 0x10024170, 0, 0xffffffff, 'x', "OTG ULPI Viewport (ULPIVIEW)" },
{ "UOG_CFGFLAG", 0x10024180, 0, 0xffffffff, 'x', "Config Flag (UOG_CFGFLAG)" },
{ "UOG_PORTSC1", 0x10024184, 0, 0xffffffff, 'x', "Port Status and Control (UOG_PORTSC1)" },
{ "UOG_OTGSC", 0x100241A4, 0, 0xffffffff, 'x', "On-The-Go Status and control (UOG_OTGSC)" },
@@ -831,7 +831,7 @@ static struct reg_info regs[] =
{ "UH2_ASYNCLISTADDR", 0x10024558, 0, 0xffffffff, 'x', "Host Controller Next Asynch. Address" },
{ "UH2_BURSTSIZE", 0x10024560, 0, 0xffffffff, 'x', "Host Controller Embedded TT Asynch. Buffer" },
{ "UH2_TXFILLTUNING", 0x10024564, 0, 0xffffffff, 'x', "TX FIFO Fill Tuning (UH2_TXFILLTUNING)" },
-{ "ULPIVIEW", 0x10024570, 0, 0xffffffff, 'x', "ULPI Viewport (ULPIVIEW)" },
+{ "UH2_ULPIVIEW", 0x10024570, 0, 0xffffffff, 'x', "Host2 ULPI Viewport (ULPIVIEW)" },
{ "Reserved", 0x10024580, 0, 0xffffffff, 'x', "" },
{ "UH2_PORTSC1", 0x10024584, 0, 0xffffffff, 'x', "Port Status and Control (UH2_PORTSC1)" },
{ "UH2_USBMODE", 0x100245A8, 0, 0xffffffff, 'x', "USB Device Mode (UH2_USBMODE)" },
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2010-02-16 21:36: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 1b1c16d8a95d2da379c26a736ba9865987a9e3ac (commit)
from 1d779c611fbcc6c3955948eea250e1bee814abb2 (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 1b1c16d8a95d2da379c26a736ba9865987a9e3ac
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 16 22:35:44 2010 +0100
[U-Boot] Makes fw_setenv command work with NAND Flash
-----------------------------------------------------------------------
Summary of changes:
...v-fix_build_problems_with_old_MTD_VERSION.patch | 34 +
.../u-boot-1.3.4-331-fw_env-add_NAND_support.patch | 1202 ++++++++++++++++++++
2 files changed, 1236 insertions(+), 0 deletions(-)
create mode 100644 buildroot/target/u-boot/u-boot-1.3.4-330-fw_env-fix_build_problems_with_old_MTD_VERSION.patch
create mode 100644 buildroot/target/u-boot/u-boot-1.3.4-331-fw_env-add_NAND_support.patch
diff --git a/buildroot/target/u-boot/u-boot-1.3.4-330-fw_env-fix_build_problems_with_old_MTD_VERSION.patch b/buildroot/target/u-boot/u-boot-1.3.4-330-fw_env-fix_build_problems_with_old_MTD_VERSION.patch
new file mode 100644
index 0000000..4763ff0
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-1.3.4-330-fw_env-fix_build_problems_with_old_MTD_VERSION.patch
@@ -0,0 +1,34 @@
+From: Wolfgang Denk <wd...@de...>
+Date: Tue, 2 Sep 2008 19:17:36 +0000 (+0200)
+Subject: fw_env.c: fix build problems with MTD_VERSION=old
+X-Git-Tag: v2008.10-rc1~62
+X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=1711f3bd16d1c5e9d17b4c0198b426d86999781b
+
+fw_env.c: fix build problems with MTD_VERSION=old
+
+(as needed to support old 2.4 Linux kernel based releases)
+
+Signed-off-by: Wolfgang Denk <wd...@de...>
+---
+
+diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
+index b8bca91..e4fc02d 100644
+--- a/tools/env/fw_env.c
++++ b/tools/env/fw_env.c
+@@ -33,6 +33,7 @@
+ #include <unistd.h>
+
+ #ifdef MTD_OLD
++# include <stdint.h>
+ # include <linux/mtd/mtd.h>
+ #else
+ # define __user /* nothing */
+@@ -397,7 +398,7 @@ int fw_setenv (int argc, char *argv[])
+ static int flash_io (int mode)
+ {
+ int fd, fdr, rc, otherdev, len, resid;
+- erase_info_t erase;
++ struct erase_info_user erase;
+ char *data = NULL;
+
+ if ((fd = open (DEVNAME (curdev), mode)) < 0) {
diff --git a/buildroot/target/u-boot/u-boot-1.3.4-331-fw_env-add_NAND_support.patch b/buildroot/target/u-boot/u-boot-1.3.4-331-fw_env-add_NAND_support.patch
new file mode 100644
index 0000000..679c11e
--- /dev/null
+++ b/buildroot/target/u-boot/u-boot-1.3.4-331-fw_env-add_NAND_support.patch
@@ -0,0 +1,1202 @@
+From: Guennadi Liakhovetski <lg...@de...>
+Date: Thu, 4 Sep 2008 11:01:49 +0000 (+0200)
+Subject: fw_env: add NAND support
+X-Git-Tag: v2008.10-rc1~24
+X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=5608692104efa8d56df803dc79ea41ac3607eee5
+
+fw_env: add NAND support
+
+Add support for environment in NAND with automatic NOR / NAND recognition,
+including unaligned environment, bad-block skipping, redundant environment
+copy.
+
+Signed-off-by: Guennadi Liakhovetski <lg...@de...>
+---
+
+diff --git a/tools/env/README b/tools/env/README
+index f8a644e..91e679a 100644
+--- a/tools/env/README
++++ b/tools/env/README
+@@ -22,9 +22,11 @@ following lines are relevant:
+ #define DEVICE1_OFFSET 0x0000
+ #define ENV1_SIZE 0x4000
+ #define DEVICE1_ESIZE 0x4000
++#define DEVICE1_ENVSECTORS 2
+ #define DEVICE2_OFFSET 0x0000
+ #define ENV2_SIZE 0x4000
+ #define DEVICE2_ESIZE 0x4000
++#define DEVICE2_ENVSECTORS 2
+
+ Current configuration matches the environment layout of the TRAB
+ board.
+@@ -46,3 +48,7 @@ then 1 sector.
+
+ DEVICEx_ESIZE defines the size of the first sector in the flash
+ partition where the environment resides.
++
++DEVICEx_ENVSECTORS defines the number of sectors that may be used for
++this environment instance. On NAND this is used to limit the range
++within which bad blocks are skipped, on NOR it is not used.
+diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
+index e4fc02d..b6036c8 100644
+--- a/tools/env/fw_env.c
++++ b/tools/env/fw_env.c
+@@ -2,6 +2,9 @@
+ * (C) Copyright 2000-2008
+ * Wolfgang Denk, DENX Software Engineering, wd...@de....
+ *
++ * (C) Copyright 2008
++ * Guennadi Liakhovetski, DENX Software Engineering, lg...@de....
++ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+@@ -45,36 +48,75 @@
+ #define CMD_GETENV "fw_printenv"
+ #define CMD_SETENV "fw_setenv"
+
+-typedef struct envdev_s {
++#define min(x, y) ({ \
++ typeof(x) _min1 = (x); \
++ typeof(y) _min2 = (y); \
++ (void) (&_min1 == &_min2); \
++ _min1 < _min2 ? _min1 : _min2; })
++
++struct envdev_s {
+ char devname[16]; /* Device name */
+ ulong devoff; /* Device offset */
+ ulong env_size; /* environment size */
+ ulong erase_size; /* device erase size */
+-} envdev_t;
++ ulong env_sectors; /* number of environment sectors */
++ uint8_t mtd_type; /* type of the MTD device */
++};
+
+-static envdev_t envdevices[2];
+-static int curdev;
++static struct envdev_s envdevices[2] =
++{
++ {
++ .mtd_type = MTD_ABSENT,
++ }, {
++ .mtd_type = MTD_ABSENT,
++ },
++};
++static int dev_current;
+
+ #define DEVNAME(i) envdevices[(i)].devname
+ #define DEVOFFSET(i) envdevices[(i)].devoff
+ #define ENVSIZE(i) envdevices[(i)].env_size
+ #define DEVESIZE(i) envdevices[(i)].erase_size
++#define ENVSECTORS(i) envdevices[(i)].env_sectors
++#define DEVTYPE(i) envdevices[(i)].mtd_type
+
+-#define CFG_ENV_SIZE ENVSIZE(curdev)
++#define CFG_ENV_SIZE ENVSIZE(dev_current)
+
+ #define ENV_SIZE getenvsize()
+
+-typedef struct environment_s {
+- ulong crc; /* CRC32 over data bytes */
+- unsigned char flags; /* active or obsolete */
+- char *data;
+-} env_t;
++struct env_image_single {
++ uint32_t crc; /* CRC32 over data bytes */
++ char data[];
++};
+
+-static env_t environment;
++struct env_image_redundant {
++ uint32_t crc; /* CRC32 over data bytes */
++ unsigned char flags; /* active or obsolete */
++ char data[];
++};
++
++enum flag_scheme {
++ FLAG_NONE,
++ FLAG_BOOLEAN,
++ FLAG_INCREMENTAL,
++};
++
++struct environment {
++ void *image;
++ uint32_t *crc;
++ unsigned char *flags;
++ char *data;
++ enum flag_scheme flag_scheme;
++};
++
++static struct environment environment = {
++ .flag_scheme = FLAG_NONE,
++};
+
+ static int HaveRedundEnv = 0;
+
+ static unsigned char active_flag = 1;
++/* obsolete_flag must be 0 to efficiently set it on NOR flash without erasing */
+ static unsigned char obsolete_flag = 0;
+
+
+@@ -157,7 +199,7 @@ static char default_environment[] = {
+ #ifdef CONFIG_EXTRA_ENV_SETTINGS
+ CONFIG_EXTRA_ENV_SETTINGS
+ #endif
+- "\0" /* Termimate env_t data with 2 NULs */
++ "\0" /* Termimate struct environment data with 2 NULs */
+ };
+
+ static int flash_io (int mode);
+@@ -186,7 +228,7 @@ char *fw_getenv (char *name)
+ char *env, *nxt;
+
+ if (env_init ())
+- return (NULL);
++ return NULL;
+
+ for (env = environment.data; *env; env = nxt + 1) {
+ char *val;
+@@ -195,15 +237,15 @@ char *fw_getenv (char *name)
+ if (nxt >= &environment.data[ENV_SIZE]) {
+ fprintf (stderr, "## Error: "
+ "environment not terminated\n");
+- return (NULL);
++ return NULL;
+ }
+ }
+ val = envmatch (name, env);
+ if (!val)
+ continue;
+- return (val);
++ return val;
+ }
+- return (NULL);
++ return NULL;
+ }
+
+ /*
+@@ -217,7 +259,7 @@ int fw_printenv (int argc, char *argv[])
+ int rc = 0;
+
+ if (env_init ())
+- return (-1);
++ return -1;
+
+ if (argc == 1) { /* Print all env variables */
+ for (env = environment.data; *env; env = nxt + 1) {
+@@ -225,13 +267,13 @@ int fw_printenv (int argc, char *argv[])
+ if (nxt >= &environment.data[ENV_SIZE]) {
+ fprintf (stderr, "## Error: "
+ "environment not terminated\n");
+- return (-1);
++ return -1;
+ }
+ }
+
+ printf ("%s\n", env);
+ }
+- return (0);
++ return 0;
+ }
+
+ if (strcmp (argv[1], "-n") == 0) {
+@@ -241,7 +283,7 @@ int fw_printenv (int argc, char *argv[])
+ if (argc != 2) {
+ fprintf (stderr, "## Error: "
+ "`-n' option requires exactly one argument\n");
+- return (-1);
++ return -1;
+ }
+ } else {
+ n_flag = 0;
+@@ -257,7 +299,7 @@ int fw_printenv (int argc, char *argv[])
+ if (nxt >= &environment.data[ENV_SIZE]) {
+ fprintf (stderr, "## Error: "
+ "environment not terminated\n");
+- return (-1);
++ return -1;
+ }
+ }
+ val = envmatch (name, env);
+@@ -276,11 +318,11 @@ int fw_printenv (int argc, char *argv[])
+ }
+ }
+
+- return (rc);
++ return rc;
+ }
+
+ /*
+- * Deletes or sets environment variables. Returns errno style error codes:
++ * Deletes or sets environment variables. Returns -1 and sets errno error codes:
+ * 0 - OK
+ * EINVAL - need at least 1 argument
+ * EROFS - certain variables ("ethaddr", "serial#") cannot be
+@@ -295,11 +337,12 @@ int fw_setenv (int argc, char *argv[])
+ char *name;
+
+ if (argc < 2) {
+- return (EINVAL);
++ errno = EINVAL;
++ return -1;
+ }
+
+ if (env_init ())
+- return (errno);
++ return -1;
+
+ name = argv[1];
+
+@@ -311,7 +354,8 @@ int fw_setenv (int argc, char *argv[])
+ if (nxt >= &environment.data[ENV_SIZE]) {
+ fprintf (stderr, "## Error: "
+ "environment not terminated\n");
+- return (EINVAL);
++ errno = EINVAL;
++ return -1;
+ }
+ }
+ if ((oldval = envmatch (name, env)) != NULL)
+@@ -328,7 +372,8 @@ int fw_setenv (int argc, char *argv[])
+ if ((strcmp (name, "ethaddr") == 0) ||
+ (strcmp (name, "serial#") == 0)) {
+ fprintf (stderr, "Can't overwrite \"%s\"\n", name);
+- return (EROFS);
++ errno = EROFS;
++ return -1;
+ }
+
+ if (*++nxt == '\0') {
+@@ -367,7 +412,7 @@ int fw_setenv (int argc, char *argv[])
+ fprintf (stderr,
+ "Error: environment overflow, \"%s\" deleted\n",
+ name);
+- return (-1);
++ return -1;
+ }
+ while ((*env = *name++) != '\0')
+ env++;
+@@ -383,195 +428,430 @@ int fw_setenv (int argc, char *argv[])
+
+ WRITE_FLASH:
+
+- /* Update CRC */
+- environment.crc = crc32 (0, (uint8_t*) environment.data, ENV_SIZE);
++ /*
++ * Update CRC
++ */
++ *environment.crc = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
+
+ /* write environment back to flash */
+ if (flash_io (O_RDWR)) {
+ fprintf (stderr, "Error: can't write fw_env to flash\n");
+- return (-1);
++ return -1;
+ }
+
+- return (0);
++ return 0;
+ }
+
+-static int flash_io (int mode)
++/*
++ * Test for bad block on NAND, just returns 0 on NOR, on NAND:
++ * 0 - block is good
++ * > 0 - block is bad
++ * < 0 - failed to test
++ */
++static int flash_bad_block (int fd, uint8_t mtd_type, loff_t *blockstart)
+ {
+- int fd, fdr, rc, otherdev, len, resid;
+- struct erase_info_user erase;
+- char *data = NULL;
++ if (mtd_type == MTD_NANDFLASH) {
++ int badblock = ioctl (fd, MEMGETBADBLOCK, blockstart);
+
+- if ((fd = open (DEVNAME (curdev), mode)) < 0) {
+- fprintf (stderr,
+- "Can't open %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
++ if (badblock < 0) {
++ perror ("Cannot read bad block mark");
++ return badblock;
++ }
++
++ if (badblock) {
++#ifdef DEBUG
++ fprintf (stderr, "Bad block at 0x%llx, "
++ "skipping\n", *blockstart);
++#endif
++ return badblock;
++ }
+ }
+
+- len = sizeof (environment.crc);
+- if (HaveRedundEnv) {
+- len += sizeof (environment.flags);
++ return 0;
++}
++
++/*
++ * Read data from flash at an offset into a provided buffer. On NAND it skips
++ * bad blocks but makes sure it stays within ENVSECTORS (dev) starting from
++ * the DEVOFFSET (dev) block. On NOR the loop is only run once.
++ */
++static int flash_read_buf (int dev, int fd, void *buf, size_t count,
++ off_t offset, uint8_t mtd_type)
++{
++ size_t blocklen; /* erase / write length - one block on NAND,
++ 0 on NOR */
++ size_t processed = 0; /* progress counter */
++ size_t readlen = count; /* current read length */
++ off_t top_of_range; /* end of the last block we may use */
++ off_t block_seek; /* offset inside the current block to the start
++ of the data */
++ loff_t blockstart; /* running start of the current block -
++ MEMGETBADBLOCK needs 64 bits */
++ int rc;
++
++ /*
++ * Start of the first block to be read, relies on the fact, that
++ * erase sector size is always a power of 2
++ */
++ blockstart = offset & ~(DEVESIZE (dev) - 1);
++
++ /* Offset inside a block */
++ block_seek = offset - blockstart;
++
++ if (mtd_type == MTD_NANDFLASH) {
++ /*
++ * NAND: calculate which blocks we are reading. We have
++ * to read one block at a time to skip bad blocks.
++ */
++ blocklen = DEVESIZE (dev);
++
++ /*
++ * To calculate the top of the range, we have to use the
++ * global DEVOFFSET (dev), which can be different from offset
++ */
++ top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) +
++ ENVSECTORS (dev) * blocklen;
++
++ /* Limit to one block for the first read */
++ if (readlen > blocklen - block_seek)
++ readlen = blocklen - block_seek;
++ } else {
++ blocklen = 0;
++ top_of_range = offset + count;
+ }
+
+- if (mode == O_RDWR) {
+- if (HaveRedundEnv) {
+- /* switch to next partition for writing */
+- otherdev = !curdev;
+- if ((fdr = open (DEVNAME (otherdev), mode)) < 0) {
+- fprintf (stderr,
+- "Can't open %s: %s\n",
+- DEVNAME (otherdev),
+- strerror (errno));
+- return (-1);
+- }
+- } else {
+- otherdev = curdev;
+- fdr = fd;
+- }
+- printf ("Unlocking flash...\n");
+- erase.length = DEVESIZE (otherdev);
+- erase.start = DEVOFFSET (otherdev);
+- ioctl (fdr, MEMUNLOCK, &erase);
++ /* This only runs once on NOR flash */
++ while (processed < count) {
++ rc = flash_bad_block (fd, mtd_type, &blockstart);
++ if (rc < 0) /* block test failed */
++ return -1;
+
+- if (HaveRedundEnv) {
+- erase.length = DEVESIZE (curdev);
+- erase.start = DEVOFFSET (curdev);
+- ioctl (fd, MEMUNLOCK, &erase);
+- environment.flags = active_flag;
++ if (blockstart + block_seek + readlen > top_of_range) {
++ /* End of range is reached */
++ fprintf (stderr,
++ "Too few good blocks within range\n");
++ return -1;
+ }
+
+- printf ("Done\n");
+- resid = DEVESIZE (otherdev) - CFG_ENV_SIZE;
+- if (resid) {
+- if ((data = malloc (resid)) == NULL) {
+- fprintf (stderr,
+- "Cannot malloc %d bytes: %s\n",
+- resid,
+- strerror (errno));
+- return (-1);
+- }
+- if (lseek (fdr, DEVOFFSET (otherdev) + CFG_ENV_SIZE, SEEK_SET)
+- == -1) {
+- fprintf (stderr, "seek error on %s: %s\n",
+- DEVNAME (otherdev),
+- strerror (errno));
+- return (-1);
+- }
+- if ((rc = read (fdr, data, resid)) != resid) {
+- fprintf (stderr,
+- "read error on %s: %s\n",
+- DEVNAME (otherdev),
+- strerror (errno));
+- return (-1);
+- }
++ if (rc) { /* block is bad */
++ blockstart += blocklen;
++ continue;
+ }
+
+- printf ("Erasing old environment...\n");
++ /*
++ * If a block is bad, we retry in the next block at the same
++ * offset - see common/env_nand.c::writeenv()
++ */
++ lseek (fd, blockstart + block_seek, SEEK_SET);
+
+- erase.length = DEVESIZE (otherdev);
+- erase.start = DEVOFFSET (otherdev);
+- if (ioctl (fdr, MEMERASE, &erase) != 0) {
+- fprintf (stderr, "MTD erase error on %s: %s\n",
+- DEVNAME (otherdev),
+- strerror (errno));
+- return (-1);
++ rc = read (fd, buf + processed, readlen);
++ if (rc != readlen) {
++ fprintf (stderr, "Read error on %s: %s\n",
++ DEVNAME (dev), strerror (errno));
++ return -1;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "Read 0x%x bytes at 0x%llx\n",
++ rc, blockstart + block_seek);
++#endif
++ processed += readlen;
++ readlen = min (blocklen, count - processed);
++ block_seek = 0;
++ blockstart += blocklen;
++ }
++
++ return processed;
++}
++
++/*
++ * Write count bytes at offset, but stay within ENVSETCORS (dev) sectors of
++ * DEVOFFSET (dev). Similar to the read case above, on NOR we erase and write
++ * the whole data at once.
++ */
++static int flash_write_buf (int dev, int fd, void *buf, size_t count,
++ off_t offset, uint8_t mtd_type)
++{
++ void *data;
++ struct erase_info_user erase;
++ size_t blocklen; /* length of NAND block / NOR erase sector */
++ size_t erase_len; /* whole area that can be erased - may include
++ bad blocks */
++ size_t erasesize; /* erase / write length - one block on NAND,
++ whole area on NOR */
++ size_t processed = 0; /* progress counter */
++ size_t write_total; /* total size to actually write - excludinig
++ bad blocks */
++ off_t erase_offset; /* offset to the first erase block (aligned)
++ below offset */
++ off_t block_seek; /* offset inside the erase block to the start
++ of the data */
++ off_t top_of_range; /* end of the last block we may use */
++ loff_t blockstart; /* running start of the current block -
++ MEMGETBADBLOCK needs 64 bits */
++ int rc;
++
++ blocklen = DEVESIZE (dev);
++
++ /* Erase sector size is always a power of 2 */
++ top_of_range = (DEVOFFSET (dev) & ~(blocklen - 1)) +
++ ENVSECTORS (dev) * blocklen;
+
+- printf ("Done\n");
++ erase_offset = offset & ~(blocklen - 1);
+
+- printf ("Writing environment to %s...\n", DEVNAME (otherdev));
+- if (lseek (fdr, DEVOFFSET (otherdev), SEEK_SET) == -1) {
++ /* Maximum area we may use */
++ erase_len = top_of_range - erase_offset;
++
++ blockstart = erase_offset;
++ /* Offset inside a block */
++ block_seek = offset - erase_offset;
++
++ /*
++ * Data size we actually have to write: from the start of the block
++ * to the start of the data, then count bytes of data, and to the
++ * end of the block
++ */
++ write_total = (block_seek + count + blocklen - 1) & ~(blocklen - 1);
++
++ /*
++ * Support data anywhere within erase sectors: read out the complete
++ * area to be erased, replace the environment image, write the whole
++ * block back again.
++ */
++ if (write_total > count) {
++ data = malloc (erase_len);
++ if (!data) {
+ fprintf (stderr,
+- "seek error on %s: %s\n",
+- DEVNAME (otherdev), strerror (errno));
+- return (-1);
++ "Cannot malloc %u bytes: %s\n",
++ erase_len, strerror (errno));
++ return -1;
+ }
+- if (write (fdr, &environment, len) != len) {
+- fprintf (stderr,
+- "CRC write error on %s: %s\n",
+- DEVNAME (otherdev), strerror (errno));
+- return (-1);
++
++ rc = flash_read_buf (dev, fd, data, write_total, erase_offset,
++ mtd_type);
++ if (write_total != rc)
++ return -1;
++
++ /* Overwrite the old environment */
++ memcpy (data + block_seek, buf, count);
++ } else {
++ /*
++ * We get here, iff offset is block-aligned and count is a
++ * multiple of blocklen - see write_total calculation above
++ */
++ data = buf;
++ }
++
++ if (mtd_type == MTD_NANDFLASH) {
++ /*
++ * NAND: calculate which blocks we are writing. We have
++ * to write one block at a time to skip bad blocks.
++ */
++ erasesize = blocklen;
++ } else {
++ erasesize = erase_len;
++ }
++
++ erase.length = erasesize;
++
++ /* This only runs once on NOR flash */
++ while (processed < write_total) {
++ rc = flash_bad_block (fd, mtd_type, &blockstart);
++ if (rc < 0) /* block test failed */
++ return rc;
++
++ if (blockstart + erasesize > top_of_range) {
++ fprintf (stderr, "End of range reached, aborting\n");
++ return -1;
+ }
+- if (write (fdr, environment.data, ENV_SIZE) != ENV_SIZE) {
++
++ if (rc) { /* block is bad */
++ blockstart += blocklen;
++ continue;
++ }
++
++ erase.start = blockstart;
++ ioctl (fd, MEMUNLOCK, &erase);
++
++ if (ioctl (fd, MEMERASE, &erase) != 0) {
++ fprintf (stderr, "MTD erase error on %s: %s\n",
++ DEVNAME (dev),
++ strerror (errno));
++ return -1;
++ }
++
++ if (lseek (fd, blockstart, SEEK_SET) == -1) {
+ fprintf (stderr,
+- "Write error on %s: %s\n",
+- DEVNAME (otherdev), strerror (errno));
+- return (-1);
++ "Seek error on %s: %s\n",
++ DEVNAME (dev), strerror (errno));
++ return -1;
+ }
+- if (resid) {
+- if (write (fdr, data, resid) != resid) {
+- fprintf (stderr,
+- "write error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
+- }
+- free (data);
++
++#ifdef DEBUG
++ printf ("Write 0x%x bytes at 0x%llx\n", erasesize, blockstart);
++#endif
++ if (write (fd, data + processed, erasesize) != erasesize) {
++ fprintf (stderr, "Write error on %s: %s\n",
++ DEVNAME (dev), strerror (errno));
++ return -1;
+ }
++
++ ioctl (fd, MEMLOCK, &erase);
++
++ processed += blocklen;
++ block_seek = 0;
++ blockstart += blocklen;
++ }
++
++ if (write_total > count)
++ free (data);
++
++ return processed;
++}
++
++/*
++ * Set obsolete flag at offset - NOR flash only
++ */
++static int flash_flag_obsolete (int dev, int fd, off_t offset)
++{
++ int rc;
++
++ /* This relies on the fact, that obsolete_flag == 0 */
++ rc = lseek (fd, offset, SEEK_SET);
++ if (rc < 0) {
++ fprintf (stderr, "Cannot seek to set the flag on %s \n",
++ DEVNAME (dev));
++ return rc;
++ }
++ rc = write (fd, &obsolete_flag, sizeof (obsolete_flag));
++ if (rc < 0)
++ perror ("Could not set obsolete flag");
++
++ return rc;
++}
++
++static int flash_write (int fd_current, int fd_target, int dev_target)
++{
++ int rc;
++
++ switch (environment.flag_scheme) {
++ case FLAG_NONE:
++ break;
++ case FLAG_INCREMENTAL:
++ (*environment.flags)++;
++ break;
++ case FLAG_BOOLEAN:
++ *environment.flags = active_flag;
++ break;
++ default:
++ fprintf (stderr, "Unimplemented flash scheme %u \n",
++ environment.flag_scheme);
++ return -1;
++ }
++
++#ifdef DEBUG
++ printf ("Writing new environment at 0x%lx on %s\n",
++ DEVOFFSET (dev_target), DEVNAME (dev_target));
++#endif
++ rc = flash_write_buf (dev_target, fd_target, environment.image,
++ CFG_ENV_SIZE, DEVOFFSET (dev_target),
++ DEVTYPE(dev_target));
++ if (rc < 0)
++ return rc;
++
++ if (environment.flag_scheme == FLAG_BOOLEAN) {
++ /* Have to set obsolete flag */
++ off_t offset = DEVOFFSET (dev_current) +
++ offsetof (struct env_image_redundant, flags);
++#ifdef DEBUG
++ printf ("Setting obsolete flag in environment at 0x%lx on %s\n",
++ DEVOFFSET (dev_current), DEVNAME (dev_current));
++#endif
++ flash_flag_obsolete (dev_current, fd_current, offset);
++ }
++
++ return 0;
++}
++
++static int flash_read (int fd)
++{
++ struct mtd_info_user mtdinfo;
++ int rc;
++
++ rc = ioctl (fd, MEMGETINFO, &mtdinfo);
++ if (rc < 0) {
++ perror ("Cannot get MTD information");
++ return -1;
++ }
++
++ if (mtdinfo.type != MTD_NORFLASH && mtdinfo.type != MTD_NANDFLASH) {
++ fprintf (stderr, "Unsupported flash type %u\n", mtdinfo.type);
++ return -1;
++ }
++
++ DEVTYPE(dev_current) = mtdinfo.type;
++
++ rc = flash_read_buf (dev_current, fd, environment.image, CFG_ENV_SIZE,
++ DEVOFFSET (dev_current), mtdinfo.type);
++
++ return (rc != CFG_ENV_SIZE) ? -1 : 0;
++}
++
++static int flash_io (int mode)
++{
++ int fd_current, fd_target, rc, dev_target;
++
++ /* dev_current: fd_current, erase_current */
++ fd_current = open (DEVNAME (dev_current), mode);
++ if (fd_current < 0) {
++ fprintf (stderr,
++ "Can't open %s: %s\n",
++ DEVNAME (dev_current), strerror (errno));
++ return -1;
++ }
++
++ if (mode == O_RDWR) {
+ if (HaveRedundEnv) {
+- /* change flag on current active env partition */
+- if (lseek (fd, DEVOFFSET (curdev) + sizeof (ulong), SEEK_SET)
+- == -1) {
+- fprintf (stderr, "seek error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
+- }
+- if (write (fd, &obsolete_flag, sizeof (obsolete_flag)) !=
+- sizeof (obsolete_flag)) {
++ /* switch to next partition for writing */
++ dev_target = !dev_current;
++ /* dev_target: fd_target, erase_target */
++ fd_target = open (DEVNAME (dev_target), mode);
++ if (fd_target < 0) {
+ fprintf (stderr,
+- "Write error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
++ "Can't open %s: %s\n",
++ DEVNAME (dev_target),
++ strerror (errno));
++ rc = -1;
++ goto exit;
+ }
++ } else {
++ dev_target = dev_current;
++ fd_target = fd_current;
+ }
+- printf ("Done\n");
+- printf ("Locking ...\n");
+- erase.length = DEVESIZE (otherdev);
+- erase.start = DEVOFFSET (otherdev);
+- ioctl (fdr, MEMLOCK, &erase);
++
++ rc = flash_write (fd_current, fd_target, dev_target);
++
+ if (HaveRedundEnv) {
+- erase.length = DEVESIZE (curdev);
+- erase.start = DEVOFFSET (curdev);
+- ioctl (fd, MEMLOCK, &erase);
+- if (close (fdr)) {
++ if (close (fd_target)) {
+ fprintf (stderr,
+ "I/O error on %s: %s\n",
+- DEVNAME (otherdev),
++ DEVNAME (dev_target),
+ strerror (errno));
+- return (-1);
++ rc = -1;
+ }
+ }
+- printf ("Done\n");
+ } else {
+-
+- if (lseek (fd, DEVOFFSET (curdev), SEEK_SET) == -1) {
+- fprintf (stderr,
+- "seek error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
+- }
+- if (read (fd, &environment, len) != len) {
+- fprintf (stderr,
+- "CRC read error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
+- }
+- if ((rc = read (fd, environment.data, ENV_SIZE)) != ENV_SIZE) {
+- fprintf (stderr,
+- "Read error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
+- }
++ rc = flash_read (fd_current);
+ }
+
+- if (close (fd)) {
++exit:
++ if (close (fd_current)) {
+ fprintf (stderr,
+- "I/O error on %s: %s\n",
+- DEVNAME (curdev), strerror (errno));
+- return (-1);
++ "I/O error on %s: %s\n",
++ DEVNAME (dev_current), strerror (errno));
++ return -1;
+ }
+
+- /* everything ok */
+- return (0);
++ return rc;
+ }
+
+ /*
+@@ -585,10 +865,10 @@ static char *envmatch (char * s1, char * s2)
+
+ while (*s1 == *s2++)
+ if (*s1++ == '=')
+- return (s2);
++ return s2;
+ if (*s1 == '\0' && *(s2 - 1) == '=')
+- return (s2);
+- return (NULL);
++ return s2;
++ return NULL;
+ }
+
+ /*
+@@ -596,108 +876,156 @@ static char *envmatch (char * s1, char * s2)
+ */
+ static int env_init (void)
+ {
++ int crc0, crc0_ok;
++ char flag0;
++ void *addr0;
++
+ int crc1, crc1_ok;
+- char *addr1;
++ char flag1;
++ void *addr1;
+
+- int crc2, crc2_ok;
+- char flag1, flag2, *addr2;
++ struct env_image_single *single;
++ struct env_image_redundant *redundant;
+
+ if (parse_config ()) /* should fill envdevices */
+- return 1;
++ return -1;
+
+- if ((addr1 = calloc (1, ENV_SIZE)) == NULL) {
++ addr0 = calloc (1, CFG_ENV_SIZE);
++ if (addr0 == NULL) {
+ fprintf (stderr,
+ "Not enough memory for environment (%ld bytes)\n",
+- ENV_SIZE);
+- return (errno);
++ CFG_ENV_SIZE);
++ return -1;
+ }
+
+ /* read environment from FLASH to local buffer */
+- environment.data = addr1;
+- curdev = 0;
+- if (flash_io (O_RDONLY)) {
+- return (errno);
++ environment.image = addr0;
++
++ if (HaveRedundEnv) {
++ redundant = addr0;
++ environment.crc = &redundant->crc;
++ environment.flags = &redundant->flags;
++ environment.data = redundant->data;
++ } else {
++ single = addr0;
++ environment.crc = &single->crc;
++ environment.flags = NULL;
++ environment.data = single->data;
+ }
+
+- crc1_ok = ((crc1 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE))
+- == environment.crc);
++ dev_current = 0;
++ if (flash_io (O_RDONLY))
++ return -1;
++
++ crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
++ crc0_ok = (crc0 == *environment.crc);
+ if (!HaveRedundEnv) {
+- if (!crc1_ok) {
++ if (!crc0_ok) {
+ fprintf (stderr,
+ "Warning: Bad CRC, using default environment\n");
+ memcpy(environment.data, default_environment, sizeof default_environment);
+ }
+ } else {
+- flag1 = environment.flags;
++ flag0 = *environment.flags;
+
+- curdev = 1;
+- if ((addr2 = calloc (1, ENV_SIZE)) == NULL) {
++ dev_current = 1;
++ addr1 = calloc (1, CFG_ENV_SIZE);
++ if (addr1 == NULL) {
+ fprintf (stderr,
+ "Not enough memory for environment (%ld bytes)\n",
+- ENV_SIZE);
+- return (errno);
++ CFG_ENV_SIZE);
++ return -1;
+ }
+- environment.data = addr2;
++ redundant = addr1;
+
+- if (flash_io (O_RDONLY)) {
+- return (errno);
++ /*
++ * have to set environment.image for flash_read(), careful -
++ * other pointers in environment still point inside addr0
++ */
++ environment.image = addr1;
++ if (flash_io (O_RDONLY))
++ return -1;
++
++ /* Check flag scheme compatibility */
++ if (DEVTYPE(dev_current) == MTD_NORFLASH &&
++ DEVTYPE(!dev_current) == MTD_NORFLASH) {
++ environment.flag_scheme = FLAG_BOOLEAN;
++ } else if (DEVTYPE(dev_current) == MTD_NANDFLASH &&
++ DEVTYPE(!dev_current) == MTD_NANDFLASH) {
++ environment.flag_scheme = FLAG_INCREMENTAL;
++ } else {
++ fprintf (stderr, "Incompatible flash types!\n");
++ return -1;
+ }
+
+- crc2_ok = ((crc2 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE))
+- == environment.crc);
+- flag2 = environment.flags;
+-
+- if (crc1_ok && !crc2_ok) {
+- environment.data = addr1;
+- environment.flags = flag1;
+- environment.crc = crc1;
+- curdev = 0;
+- free (addr2);
+- } else if (!crc1_ok && crc2_ok) {
+- environment.data = addr2;
+- environment.flags = flag2;
+- environment.crc = crc2;
+- curdev = 1;
+- free (addr1);
+- } else if (!crc1_ok && !crc2_ok) {
++ crc1 = crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
++ crc1_ok = (crc1 == redundant->crc);
++ flag1 = redundant->flags;
++
++ if (crc0_ok && !crc1_ok) {
++ dev_current = 0;
++ } else if (!crc0_ok && crc1_ok) {
++ dev_current = 1;
++ } else if (!crc0_ok && !crc1_ok) {
+ fprintf (stderr,
+ "Warning: Bad CRC, using default environment\n");
+- memcpy(environment.data, default_environment, sizeof default_environment);
+- curdev = 0;
+- free (addr1);
+- } else if (flag1 == active_flag && flag2 == obsolete_flag) {
+- environment.data = addr1;
+- environment.flags = flag1;
+- environment.crc = crc1;
+- curdev = 0;
+- free (addr2);
+- } else if (flag1 == obsolete_flag && flag2 == active_flag) {
+- environment.data = addr2;
+- environment.flags = flag2;
+- environment.crc = crc2;
+- curdev = 1;
+- free (addr1);
+- } else if (flag1 == flag2) {
+- environment.data = addr1;
+- environment.flags = flag1;
+- environment.crc = crc1;
+- curdev = 0;
+- free (addr2);
+- } else if (flag1 == 0xFF) {
+- environment.data = addr1;
+- environment.flags = flag1;
+- environment.crc = crc1;
+- curdev = 0;
+- free (addr2);
+- } else if (flag2 == 0xFF) {
+- environment.data = addr2;
+- environment.flags = flag2;
+- environment.crc = crc2;
+- curdev = 1;
++ memcpy (environment.data, default_environment,
++ sizeof default_environment);
++ dev_current = 0;
++ } else {
++ switch (environment.flag_scheme) {
++ case FLAG_BOOLEAN:
++ if (flag0 == active_flag &&
++ flag1 == obsolete_flag) {
++ dev_current = 0;
++ } else if (flag0 == obsolete_flag &&
++ flag1 == active_flag) {
++ dev_current = 1;
++ } else if (flag0 == flag1) {
++ dev_current = 0;
++ } else if (flag0 == 0xFF) {
++ dev_current = 0;
++ } else if (flag1 == 0xFF) {
++ dev_current = 1;
++ } else {
++ dev_current = 0;
++ }
++ break;
++ case FLAG_INCREMENTAL:
++ if ((flag0 == 255 && flag1 == 0) ||
++ flag1 > flag0)
++ dev_current = 1;
++ else if ((flag1 == 255 && flag0 == 0) ||
++ flag0 > flag1)
++ dev_current = 0;
++ else /* flags are equal - almost impossible */
++ dev_current = 0;
++ break;
++ default:
++ fprintf (stderr, "Unknown flag scheme %u \n",
++ environment.flag_scheme);
++ return -1;
++ }
++ }
++
++ /*
++ * If we are reading, we don't need the flag and the CRC any
++ * more, if we are writing, we will re-calculate CRC and update
++ * flags before writing out
++ */
++ if (dev_current) {
++ environment.image = addr1;
++ environment.crc = &redundant->crc;
++ environment.flags = &redundant->flags;
++ environment.data = redundant->data;
++ free (addr0);
++ } else {
++ environment.image = addr0;
++ /* Other pointers are already set */
+ free (addr1);
+ }
+ }
+- return (0);
++ return 0;
+ }
+
+
+@@ -710,18 +1038,20 @@ static int parse_config ()
+ if (get_config (CONFIG_FILE)) {
+ fprintf (stderr,
+ "Cannot parse config file: %s\n", strerror (errno));
+- return 1;
++ return -1;
+ }
+ #else
+ strcpy (DEVNAME (0), DEVICE1_NAME);
+ DEVOFFSET (0) = DEVICE1_OFFSET;
+ ENVSIZE (0) = ENV1_SIZE;
+ DEVESIZE (0) = DEVICE1_ESIZE;
++ ENVSECTORS (0) = DEVICE1_ENVSECTORS;
+ #ifdef HAVE_REDUND
+ strcpy (DEVNAME (1), DEVICE2_NAME);
+ DEVOFFSET (1) = DEVICE2_OFFSET;
+ ENVSIZE (1) = ENV2_SIZE;
+ DEVESIZE (1) = DEVICE2_ESIZE;
++ ENVSECTORS (1) = DEVICE2_ENVSECTORS;
+ HaveRedundEnv = 1;
+ #endif
+ #endif
+@@ -729,14 +1059,14 @@ static int parse_config ()
+ fprintf (stderr,
+ "Cannot access MTD device %s: %s\n",
+ DEVNAME (0), strerror (errno));
+- return 1;
++ return -1;
+ }
+
+ if (HaveRedundEnv && stat (DEVNAME (1), &st)) {
+ fprintf (stderr,
+ "Cannot access MTD device %s: %s\n",
+ DEVNAME (1), strerror (errno));
+- return 1;
++ return -1;
+ }
+ return 0;
+ }
+@@ -749,21 +1079,28 @@ static int get_config (char *fname)
+ int rc;
+ char dump[128];
+
+- if ((fp = fopen (fname, "r")) == NULL) {
+- return 1;
+- }
+-
+- while ((i < 2) && ((rc = fscanf (fp, "%s %lx %lx %lx",
+- DEVNAME (i),
+- &DEVOFFSET (i),
+- &ENVSIZE (i),
+- &DEVESIZE (i) )) != EOF)) {
++ fp = fopen (fname, "r");
++ if (fp == NULL)
++ return -1;
+
++ while (i < 2 && fgets (dump, sizeof (dump), fp)) {
+ /* Skip incomplete conversions and comment strings */
+- if ((rc < 3) || (*DEVNAME (i) == '#')) {
+- fgets (dump, sizeof (dump), fp); /* Consume till end */
++ if (dump[0] == '#')
+ continue;
+- }
++
++ rc = sscanf (dump, "%s %lx %lx %lx %lx",
++ DEVNAME (i),
++ &DEVOFFSET (i),
++ &ENVSIZE (i),
++ &DEVESIZE (i),
++ &ENVSECTORS (i));
++
++ if (rc < 4)
++ continue;
++
++ if (rc < 5)
++ /* Default - 1 sector */
++ ENVSECTORS (i) = 1;
+
+ i++;
+ }
+@@ -772,7 +1109,7 @@ static int get_config (char *fname)
+ HaveRedundEnv = i - 1;
+ if (!i) { /* No valid entries found */
+ errno = EINVAL;
+- return 1;
++ return -1;
+ } else
+ return 0;
+ }
+diff --git a/tools/env/fw_env.config b/tools/env/fw_env.config
+index 2432bd8..0fe37c9 100644
+--- a/tools/env/fw_env.config
++++ b/tools/env/fw_env.config
+@@ -1,7 +1,11 @@
+ # Configuration file for fw_(printenv/saveenv) utility.
+ # Up to two entries are valid, in this case the redundand
+ # environment sector is assumed present.
++# Notice, that the "Number of sectors" is ignored on NOR.
+
+-# MTD device name Device offset Env. size Flash sector size
++# MTD device name Device offset Env. size Flash sector size Number of sectors
+ /dev/mtd1 0x0000 0x4000 0x4000
+ /dev/mtd2 0x0000 0x4000 0x4000
++
++# NAND example
++#/dev/mtd0 0x4000 0x4000 0x20000 2
hooks/post-receive
--
armadeus
|