armadeus-commitlog Mailing List for armadeus (Page 124)
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: <th...@us...> - 2009-05-06 12:55:24
|
Revision: 1256
http://armadeus.svn.sourceforge.net/armadeus/?rev=1256&view=rev
Author: thom25
Date: 2009-05-06 12:55:23 +0000 (Wed, 06 May 2009)
Log Message:
-----------
[LINUX] fix pwm input freq for 9328
Modified Paths:
--------------
trunk/target/linux/modules/pwm/pwm.c
Modified: trunk/target/linux/modules/pwm/pwm.c
===================================================================
--- trunk/target/linux/modules/pwm/pwm.c 2009-05-06 12:54:42 UTC (rev 1255)
+++ trunk/target/linux/modules/pwm/pwm.c 2009-05-06 12:55:23 UTC (rev 1256)
@@ -219,7 +219,7 @@
#ifdef CONFIG_ARCH_MX2
return clk_get_rate(pwm->clk);
#else
- return 16000000;
+ return 8000000;
#endif
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-06 12:54:50
|
Revision: 1255
http://armadeus.svn.sourceforge.net/armadeus/?rev=1255&view=rev
Author: artemys
Date: 2009-05-06 12:54:42 +0000 (Wed, 06 May 2009)
Log Message:
-----------
[TEST] Removes warnings when compiling testplaymode
Modified Paths:
--------------
trunk/target/linux/modules/pwm/test/testplaymode.c
Modified: trunk/target/linux/modules/pwm/test/testplaymode.c
===================================================================
--- trunk/target/linux/modules/pwm/test/testplaymode.c 2009-05-06 12:16:40 UTC (rev 1254)
+++ trunk/target/linux/modules/pwm/test/testplaymode.c 2009-05-06 12:54:42 UTC (rev 1255)
@@ -18,6 +18,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <fcntl.h>
//#include <errno.h>
//#include "MX1_def.h"
@@ -53,29 +54,28 @@
short ret;
unsigned char* buffer;
- if( argc != 1 )
- {
+ if (argc != 1) {
printf("Opening file: %s\n", argv[1]);
readfd = open( argv[1], O_RDONLY );
}
handle = open("/dev/pwm", O_RDWR);
- if( handle < 0 ) {
+ if (handle < 0) {
printf("can not open file /dev/pwm\n");
- exit( 1 );
+ exit(1);
}
printf("Playing wave file...\n");
- // Play wave
+ /* Play wave */
ioctl(handle, PWM_IOC_SMODE, PWM_PLAY_MODE);
ioctl(handle, PWM_IOC_SFREQ, SAM_RATE);
ioctl(handle, PWM_IOC_SDATALEN, DATA_LEN);
- if( readfd ) {
+ if (readfd) {
buffer = (unsigned char*)malloc( BUFFER_SIZE );
- if( buffer ) {
- while( (nb = read( readfd, buffer, BUFFER_SIZE )) > 0 ) {
+ if (buffer) {
+ while ( (nb = read( readfd, buffer, BUFFER_SIZE )) > 0 ) {
write( handle, buffer, nb );
printf("read %d\n", nb);
}
@@ -83,7 +83,7 @@
} else {
printf("No data file given, playing default sound of size %d\n", DATA_SZ);
buffer = (unsigned char*)data;
- while( nb < DATA_SZ ) {
+ while (nb < DATA_SZ) {
written = write(handle, buffer, DATA_SZ);
buffer += written;
nb += written;
@@ -93,10 +93,11 @@
}
printf("End of sound playing\n");
- close( handle );
- close( readfd );
- if( buffer ) free( buffer );
+ close(handle);
+ close(readfd);
+ if (buffer)
+ free( buffer );
- exit( 0 );
+ exit(0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-06 12:21:15
|
Revision: 1254
http://armadeus.svn.sourceforge.net/armadeus/?rev=1254&view=rev
Author: artemys
Date: 2009-05-06 12:16:40 +0000 (Wed, 06 May 2009)
Log Message:
-----------
[TEST] Updates some test scripts for APF9328
Modified Paths:
--------------
trunk/target/test/packages/test_imxregs.sh
trunk/target/test/packages/test_mplayer.sh
trunk/target/test/test_adc.sh
trunk/target/test/test_rs232.sh
trunk/target/test/test_sound.sh
trunk/target/test/test_touchscreen.sh
Modified: trunk/target/test/packages/test_imxregs.sh
===================================================================
--- trunk/target/test/packages/test_imxregs.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/packages/test_imxregs.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -28,7 +28,7 @@
ID_REG="CID"
ID_VAL="0x2882101d"
else
- ID_REG="SDIR"
+ ID_REG="SIDR"
ID_VAL="0x00d4c01d"
fi
echo "$APF"
Modified: trunk/target/test/packages/test_mplayer.sh
===================================================================
--- trunk/target/test/packages/test_mplayer.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/packages/test_mplayer.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -31,7 +31,7 @@
# Get video
echo "Downloading file from Internet"
# Suppose that network was correctly set before
- wget http://dl.free.fr/jVwLTYA1T -O $VIDEO_FILE_NAME
+ wget http://dl.free.fr/oBjrVd6n8 -O $VIDEO_FILE_NAME
# Launch it
$EXEC_NAME -nosound -fs $VIDEO_FILE_NAME
if [ "$?" == 0 ]; then
Modified: trunk/target/test/test_adc.sh
===================================================================
--- trunk/target/test/test_adc.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/test_adc.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -19,18 +19,19 @@
{
show_test_banner "ADC"
- modprobe spi_imx
modprobe max1027
if [ "$?" == 0 ]; then
# Slow mode
let set=0x62; echo $set > /sys/bus/spi/devices/spi1.0/setup
- sleep 0.1
+ echo "WAIT" > /dev/null
let conv=0xf9; echo $conv > /sys/bus/spi/devices/spi1.0/conversion
- sleep 0.1
+ echo "WAIT" > /dev/null
temp=`cat /sys/bus/spi/devices/spi1.0/temp1_input`
if [ "$temp" != "0" ]; then
echo "Temp: $temp m°C"
echo_test_ok
+ else
+ exit_failed
fi
else
echo "Hardware not found !"
@@ -38,3 +39,4 @@
}
test_ADC
+
Modified: trunk/target/test/test_rs232.sh
===================================================================
--- trunk/target/test/test_rs232.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/test_rs232.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -15,6 +15,16 @@
source ./test_env.sh
+echo_jumper_help_apf9328()
+{
+ echo " (Pin 1 & 3 of UART connector)"
+}
+
+echo_jumper_help_apf27()
+{
+ echo " (Pin X & X of XXXX connector)"
+}
+
test_serial_port()
{
show_test_banner "Serial port $1"
@@ -24,14 +34,19 @@
stty -F $SERIAL_DEVICE -echo
if [ "$?" == 0 ]; then
- ask_user "Connect loopback jumper and press <ENTER>"
+ echo -n "Connect loopback jumper"
+ execute_for_target echo_jumper_help_apf9328 echo_jumper_help_apf27
+ ask_user "and then press <ENTER>"
cat $SERIAL_DEVICE > $TEMP_FILE &
pid=$!
+ echo -n "."; sleep 1
echo "SERIAL PORT$1 IS WORKING !!" > $SERIAL_DEVICE
- sleep 1
+ echo -n "."; sleep 1; echo
grep WORKING $TEMP_FILE
if [ "$?" == 0 ]; then
echo_test_ok
+ else
+ exit_failed
fi
kill $pid
else
Modified: trunk/target/test/test_sound.sh
===================================================================
--- trunk/target/test/test_sound.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/test_sound.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -19,7 +19,6 @@
{
show_test_banner "Sound / ALSA"
- modprobe spi_imx
modprobe snd-imx-alsa-tsc2102
if [ "$?" != 0 ]; then
exit_failed
Modified: trunk/target/test/test_touchscreen.sh
===================================================================
--- trunk/target/test/test_touchscreen.sh 2009-05-04 09:53:36 UTC (rev 1253)
+++ trunk/target/test/test_touchscreen.sh 2009-05-06 12:16:40 UTC (rev 1254)
@@ -19,7 +19,6 @@
{
show_test_banner "Touchscreen"
- modprobe spi_imx
modprobe tsc2102_ts
sleep 1
@@ -40,6 +39,10 @@
exit_failed
fi
+ echo "You can now calibrate the Touch..."
+ sleep 1
+ ts_calibrate
+
echo_test_ok
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-04 09:53:44
|
Revision: 1253
http://armadeus.svn.sourceforge.net/armadeus/?rev=1253&view=rev
Author: artemys
Date: 2009-05-04 09:53:36 +0000 (Mon, 04 May 2009)
Log Message:
-----------
[TEST] Makes FPGA loading test run on APF9328 too
Modified Paths:
--------------
trunk/buildroot/package/armadeus-testsuite/armadeus-tests.mk
trunk/target/test/test_fpga.sh
trunk/target/test/test_gpio.sh
trunk/target/test/test_helpers.sh
Added Paths:
-----------
trunk/target/test/data/
trunk/target/test/data/fpga
Modified: trunk/buildroot/package/armadeus-testsuite/armadeus-tests.mk
===================================================================
--- trunk/buildroot/package/armadeus-testsuite/armadeus-tests.mk 2009-05-01 13:31:39 UTC (rev 1252)
+++ trunk/buildroot/package/armadeus-testsuite/armadeus-tests.mk 2009-05-04 09:53:36 UTC (rev 1253)
@@ -9,23 +9,24 @@
ARMADEUS-TESTSUITE_DIR:=$(BUILD_DIR)/armadeus-testsuite-$(ARMADEUS-TESTSUITE_VER)
ARMADEUS-TESTSUITE_CAT:=zcat
ARMADEUS-TESTSUITE_BINARY:=test_env.sh
-ARMADEUS-TESTSUITE_TARGET_DIR:=/usr/bin/testsuite
+ARMADEUS-TESTSUITE_TARGET_DIR:=$(TARGET_DIR)/usr/bin/testsuite
ARMADEUS-TESTSUITE_TARGET_BINARY:=$(ARMADEUS-TESTSUITE_TARGET_DIR)/$(ARMADEUS-TESTSUITE_BINARY)
$(ARMADEUS-TESTSUITE_DIR)/.unpacked:
mkdir -p $(ARMADEUS-TESTSUITE_DIR)/
- cp -r $(ARMADEUS-TESTSUITE_SOURCE)/* $(ARMADEUS-TESTSUITE_DIR)/
+ cp -prL $(ARMADEUS-TESTSUITE_SOURCE)/* $(ARMADEUS-TESTSUITE_DIR)/
touch $@
-$(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_BINARY): $(ARMADEUS-TESTSUITE_DIR)/.unpacked
- mkdir -p $(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_DIR)
- find $(ARMADEUS-TESTSUITE_DIR) -name "*.sh" -exec install -D {} $(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_DIR) \;
+$(ARMADEUS-TESTSUITE_TARGET_BINARY): $(ARMADEUS-TESTSUITE_DIR)/.unpacked
+ mkdir -p $(ARMADEUS-TESTSUITE_TARGET_DIR)
+ find $(ARMADEUS-TESTSUITE_DIR) -name "*.sh" -exec install -D {} $(ARMADEUS-TESTSUITE_TARGET_DIR) \;
+ cp -r $(ARMADEUS-TESTSUITE_DIR)/data $(ARMADEUS-TESTSUITE_TARGET_DIR)/
touch $@
-armadeus-testsuite: $(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_BINARY)
+armadeus-testsuite: $(ARMADEUS-TESTSUITE_TARGET_BINARY)
armadeus-testsuite-clean:
- rm -rf $(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_DIR)
+ rm -rf $(ARMADEUS-TESTSUITE_TARGET_DIR)
armadeus-testsuite-dirclean:
rm -rf $(ARMADEUS-TESTSUITE_DIR)
Added: trunk/target/test/data/fpga
===================================================================
--- trunk/target/test/data/fpga (rev 0)
+++ trunk/target/test/data/fpga 2009-05-04 09:53:36 UTC (rev 1253)
@@ -0,0 +1 @@
+link ../../../firmware/leds/blinking_led/bin/
\ No newline at end of file
Property changes on: trunk/target/test/data/fpga
___________________________________________________________________
Added: svn:special
+ *
Modified: trunk/target/test/test_fpga.sh
===================================================================
--- trunk/target/test/test_fpga.sh 2009-05-01 13:31:39 UTC (rev 1252)
+++ trunk/target/test/test_fpga.sh 2009-05-04 09:53:36 UTC (rev 1253)
@@ -17,22 +17,33 @@
FPGA_LOAD_DEV="/dev/fpgaloader"
TEST_BITFILE=/tmp/led.bit
+
+load_apf9328()
+{
+ dd if=./data/fpga/blinking_led_apf9328_200k.bit of=$FPGA_LOAD_DEV
+}
+
+load_apf27()
+{
+ dd if=./data/fpga/blinking_led_apf27_200k.bit of=$FPGA_LOAD_DEV
+}
+
test_fpga_load()
{
show_test_banner "FPGA"
modprobe fpgaloader
- if [ "$?" != 0 ] || [ ! -c "$FPGA_LOAD_DEV" ] ; then
+ RES=$?
+ sleep 1
+ if [ "$RES" != 0 ] || [ ! -c "$FPGA_LOAD_DEV" ] ; then
echo "Module failed to load"
exit_failed
fi
cat /proc/driver/fpga/loader
- echo "Downloading bitfile from Internet"
- # Suppose that network was correctly set before
- wget http://dl.free.fr/ppbCdFTqs -O $TEST_BITFILE
+
+ execute_for_target load_apf9328 load_apf27
- dd if=$TEST_BITFILE of=$FPGA_LOAD_DEV
if [ "$?" == 0 ]; then
ask_user "Did you see the LED on FPGA ? (y/n)"
if [ "$response" == "y" ]; then
Modified: trunk/target/test/test_gpio.sh
===================================================================
--- trunk/target/test/test_gpio.sh 2009-05-01 13:31:39 UTC (rev 1252)
+++ trunk/target/test/test_gpio.sh 2009-05-04 09:53:36 UTC (rev 1253)
@@ -49,13 +49,7 @@
exit_failed
fi
- BOARD=`cat /etc/machine`
- if [ "$BOARD" == "APF9328" ]; then
- blink_led_apf9328
- fi
- if [ "$BOARD" == "APF27" ]; then
- blink_led_apf27
- fi
+ execute_for_target blink_led_apf9328 blink_led_apf27
ask_user "Did you see a LED blinking ? (y/n)"
if [ "$response" != "y" ]; then
Modified: trunk/target/test/test_helpers.sh
===================================================================
--- trunk/target/test/test_helpers.sh 2009-05-01 13:31:39 UTC (rev 1252)
+++ trunk/target/test/test_helpers.sh 2009-05-04 09:53:36 UTC (rev 1253)
@@ -93,3 +93,13 @@
sleep 1
}
+execute_for_target()
+{
+ BOARD=`cat /etc/machine`
+ if [ "$BOARD" == "APF9328" ] && [ "$1" != "" ]; then
+ $1
+ fi
+ if [ "$BOARD" == "APF27" ] && [ "$2" != "" ]; then
+ $2
+ fi
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-01 14:22:21
|
Revision: 1252
http://armadeus.svn.sourceforge.net/armadeus/?rev=1252&view=rev
Author: artemys
Date: 2009-05-01 13:31:39 +0000 (Fri, 01 May 2009)
Log Message:
-----------
[LINUX] Makes imx_udc compiles again on 2.6.29 (part2)
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/032-armadeus-imx_udc_makes_kconfig_selectable_on_imx_arch.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/099-armadeus-imx_clock-adds_fake_clk_set_rate.patch
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/032-armadeus-imx_udc_makes_kconfig_selectable_on_imx_arch.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/032-armadeus-imx_udc_makes_kconfig_selectable_on_imx_arch.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/032-armadeus-imx_udc_makes_kconfig_selectable_on_imx_arch.patch 2009-05-01 13:31:39 UTC (rev 1252)
@@ -0,0 +1,15 @@
+Index: linux-2.6.29/drivers/usb/gadget/Kconfig
+===================================================================
+--- linux-2.6.29.orig/drivers/usb/gadget/Kconfig 2009-05-01 14:28:39.000000000 +0200
++++ linux-2.6.29/drivers/usb/gadget/Kconfig 2009-05-01 14:29:27.000000000 +0200
+@@ -307,8 +307,8 @@
+ the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin
+
+ config USB_GADGET_IMX
+- boolean "Freescale IMX USB Peripheral Controller"
+- depends on ARCH_MX1
++ boolean "Freescale i.MX1/L/S USB Peripheral Controller"
++ depends on ARCH_MX1 || ARCH_IMX
+ help
+ Freescale's IMX series include an integrated full speed
+ USB 1.1 device controller. The controller in the IMX series
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/099-armadeus-imx_clock-adds_fake_clk_set_rate.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/099-armadeus-imx_clock-adds_fake_clk_set_rate.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/099-armadeus-imx_clock-adds_fake_clk_set_rate.patch 2009-05-01 13:31:39 UTC (rev 1252)
@@ -0,0 +1,20 @@
+Adds a fake clk_set_rate() until MX1 platform officially exists
+in plat-mxc. (This function is needed by imx_udc).
+
+Index: linux-2.6.29/arch/arm/mach-imx/clock.c
+===================================================================
+--- linux-2.6.29.orig/arch/arm/mach-imx/clock.c 2009-05-01 15:12:06.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/clock.c 2009-05-01 15:13:29.000000000 +0200
+@@ -217,6 +217,12 @@
+ }
+ EXPORT_SYMBOL(clk_get_rate);
+
++int clk_set_rate(struct clk *clk, unsigned long rate)
++{
++ return 0;
++}
++EXPORT_SYMBOL(clk_set_rate);
++
+ int imx_clocks_init(void)
+ {
+ int i;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-01 13:01:35
|
Revision: 1251
http://armadeus.svn.sourceforge.net/armadeus/?rev=1251&view=rev
Author: artemys
Date: 2009-05-01 12:15:24 +0000 (Fri, 01 May 2009)
Log Message:
-----------
[LINUX] Makes imx_udc compiles again on 2.6.29
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-add_USB_registers.patch
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/031-armadeus-imx_udc_add_usb_h_include_to_arch_arm_mach-imx_include_mach.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-add_USB_registers.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-add_USB_registers.patch 2009-05-01 11:45:49 UTC (rev 1250)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-add_USB_registers.patch 2009-05-01 12:15:24 UTC (rev 1251)
@@ -1,5 +1,7 @@
---- linux-org/arch/arm/mach-imx/include/mach/hardware.h 2006-10-01 14:28:50.000000000 +0200
-+++ linux-imx/arch/arm/mach-imx/include/mach/hardware.h 2006-10-01 14:30:04.000000000 +0200
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/hardware.h
+===================================================================
+--- linux-2.6.29.orig/arch/arm/mach-imx/include/mach/hardware.h 2009-05-01 11:35:31.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/hardware.h 2009-05-01 13:59:45.000000000 +0200
@@ -24,6 +24,8 @@
#include "imx-regs.h"
@@ -9,8 +11,10 @@
# define __REG(x) (*((volatile u32 *)IO_ADDRESS(x)))
# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
---- linux-org/arch/arm/mach-imx/include/mach/imx-regs.h 2006-09-20 05:42:06.000000000 +0200
-+++ linux-imx/arch/arm/mach-imx/include/mach/imx-regs.h 2006-10-01 14:30:04.000000000 +0200
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h
+===================================================================
+--- linux-2.6.29.orig/arch/arm/mach-imx/include/mach/imx-regs.h 2009-05-01 11:33:45.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h 2009-05-01 14:02:48.000000000 +0200
@@ -186,7 +186,7 @@
#define PB19_AF_SSI_TXCLK ( GPIO_PORTB | GPIO_AF | 19 )
#define PB20_PF_USBD_AFE ( GPIO_PORTB | GPIO_PF | 20 )
@@ -20,9 +24,9 @@
#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
-@@ -591,4 +591,132 @@
- #define UTS_RXFULL (1<<3) /* RxFIFO full */
- #define UTS_SOFTRST (1<<0) /* Software reset */
+@@ -373,4 +373,40 @@
+ #define TSTAT_CAPT (1<<1)
+ #define TSTAT_COMP (1<<0)
+/*
+ * CSI register
@@ -50,106 +54,14 @@
+#define CSICR1_REDGE (1<<1)
+#define CSICR1_ENABLE (1)
+
-+/*
-+ * USB register
-+ */
-+#define USB_FRAME __REG(0x00 + IMX_USBD_BASE) /* USB frame */
-+#define USB_SPEC __REG(0x04 + IMX_USBD_BASE) /* USB Spec */
-+#define USB_STAT __REG(0x08 + IMX_USBD_BASE) /* USB Status */
-+#define USB_CTRL __REG(0x0C + IMX_USBD_BASE) /* USB Control */
-+#define USB_DADR __REG(0x10 + IMX_USBD_BASE) /* USB Descriptor RAM address */
-+#define USB_DDAT __REG(0x14 + IMX_USBD_BASE) /* USB Descriptor RAM/Endpoint buffer data */
-+#define USB_INTR __REG(0x18 + IMX_USBD_BASE) /* USB interrupt */
-+#define USB_MASK __REG(0x1C + IMX_USBD_BASE) /* USB Mask */
-+#define USB_ENAB __REG(0x24 + IMX_USBD_BASE) /* USB Enable */
-+#define USB_EP_STAT(x) __REG(0x30 + IMX_USBD_BASE + (x*0x30)) /* USB status/control */
-+#define USB_EP_INTR(x) __REG(0x34 + IMX_USBD_BASE + (x*0x30)) /* USB interrupt */
-+#define USB_EP_MASK(x) __REG(0x38 + IMX_USBD_BASE + (x*0x30)) /* USB mask */
-+#define USB_EP_FDAT(x) __REG(0x3C + IMX_USBD_BASE + (x*0x30)) /* USB FIFO data */
-+#define USB_EP_FDAT0(x) __REG8(0x3C + IMX_USBD_BASE + (x*0x30)) /* USB FIFO data */
-+#define USB_EP_FDAT1(x) __REG8(0x3D + IMX_USBD_BASE + (x*0x30)) /* USB FIFO data */
-+#define USB_EP_FDAT2(x) __REG8(0x3E + IMX_USBD_BASE + (x*0x30)) /* USB FIFO data */
-+#define USB_EP_FDAT3(x) __REG8(0x3F + IMX_USBD_BASE + (x*0x30)) /* USB FIFO data */
-+#define USB_EP_FSTAT(x) __REG(0x40 + IMX_USBD_BASE + (x*0x30)) /* USB FIFO status */
-+#define USB_EP_FCTRL(x) __REG(0x44 + IMX_USBD_BASE + (x*0x30)) /* USB FIFO control */
-+#define USB_EP_LRFP(x) __REG(0x48 + IMX_USBD_BASE + (x*0x30)) /* USB last read frame pointer */
-+#define USB_EP_LWFP(x) __REG(0x4C + IMX_USBD_BASE + (x*0x30)) /* USB last write frame pointer */
-+#define USB_EP_FALRM(x) __REG(0x50 + IMX_USBD_BASE + (x*0x30)) /* USB FIFO alarm */
-+#define USB_EP_FRDP(x) __REG(0x54 + IMX_USBD_BASE + (x*0x30)) /* USB FIFO read pointer */
-+#define USB_EP_FWRP(x) __REG(0x58 + IMX_USBD_BASE + (x*0x30)) /* USB FIFO write pointer */
++/* SPI regiters */
++#define SPI1_RXDATA __REG(IMX_SPI1_BASE + 0x00)
++#define SPI1_TXDATA __REG(IMX_SPI1_BASE + 0x04)
++#define SPI1_CONTROL __REG(IMX_SPI1_BASE + 0x08)
++#define SPI1_INT __REG(IMX_SPI1_BASE + 0x0c)
++#define SPI1_TEST __REG(IMX_SPI1_BASE + 0x10)
++#define SPI1_PERIOD __REG(IMX_SPI1_BASE + 0x14)
++#define SPI1_DMA __REG(IMX_SPI1_BASE + 0x18)
++#define SPI1_RESET __REG(IMX_SPI1_BASE + 0x1c)
+
-+/* USB Control Register Bit Fields.*/
-+#define USB_CMDOVER (1<<6) /* UDC status */
-+#define USB_CMDERROR (1<<5) /* UDC status */
-+#define USB_FE_ENA (1<<3) /* Enable Font End logic */
-+#define USB_UDC_RST (1<<2) /* UDC reset */
-+#define USB_AFE_ENA (1<<1) /* Analog Font end enable */
-+#define USB_RESUME (1<<0) /* UDC resume */
-+
-+/* USB Descriptor Ram Bit Fields */
-+#define USB_CFG (1<<31) /* Configuration */
-+#define USB_BSY (1<<30) /* Busy status */
-+#define USB_DADR_DESC (0x1FF) /* Descriptor Ram Address */
-+#define USB_DDAT_DESC (0xFF) /* Descriptor Endpoint Buffer */
-+
-+/* USB Endpoint Bit fields */
-+/* USB Endpoint status bit fields */
-+#define USB_FIFO_BCOUNT (0x7F<<16) /* Endpoint FIFO byte count */
-+#define USB_SIP (1<<8) /* Endpoint setup in progress */
-+#define USB_DIR (1<<7) /* Endpoint transfer direction */
-+#define USB_MAX (3<<5) /* Endpoint Max packet size */
-+#define USB_TYP (3<<3) /* Endpoint type */
-+#define USB_ZLPS (1<<2) /* Send zero length packet */
-+#define USB_FLUSH (1<<1) /* Endpoint FIFO Flush */
-+#define USB_STALL (1<<0) /* Force stall */
-+/* USB Endpoint FIFO status bit fields */
-+#define USB_FRAME_STAT (0xF<<24) /* Frame status bit [0-3] */
-+#define USB_ERR (1<<22) /* FIFO error */
-+#define USB_UF (1<<21) /* FIFO underflow */
-+#define USB_OF (1<<20) /* FIFO overflow */
-+#define USB_FR (1<<19) /* FIFO frame ready */
-+#define USB_FULL (1<<18) /* FIFO full */
-+#define USB_ALRM (1<<17) /* FIFO alarm */
-+#define USB_EMPTY (1<<16) /* FIFO empty */
-+/* USB Endpoint FIFO control bit fields */
-+#define USB_WFR (1<<29) /* Write frame end */
-+/* USB Endpoint FIFO interrupt bit fields */
-+#define USB_FIFO_FULL (1<<8) /* fifo full */
-+#define USB_FIFO_EMPTY (1<<7) /* fifo empty */
-+#define USB_FIFO_ERROR (1<<6) /* fifo error */
-+#define USB_FIFO_HIGH (1<<5) /* fifo high */
-+#define USB_FIFO_LOW (1<<4) /* fifo low */
-+#define USB_MDEVREQ (1<<3) /* multi Device request */
-+#define USB_EOT (1<<2) /* fifo end of transfer */
-+#define USB_DEVREQ (1<<1) /* Device request */
-+#define USB_EOF (1<<0) /* fifo end of frame */
-+
-+/* USB Interrupt Bit fields */
-+#define USB_WAKEUP (1<<31) /* Wake up Interrupt */
-+#define USB_MSOF (1<<7) /* Missed Start of Frame */
-+#define USB_SOF (1<<6) /* Start of Frame */
-+#define USB_RESET_STOP (1<<5) /* Reset Signaling stop */
-+#define USB_RESET_START (1<<4) /* Reset Signaling start */
-+#define USB_RES (1<<3) /* Suspend to resume */
-+#define USB_SUSP (1<<2) /* Active to suspend */
-+#define USB_FRAME_MATCH (1<<1) /* Frame matched */
-+#define USB_CFG_CHG (1<<0) /* Configuration change occurred */
-+
-+/* USB Enable Register Bit Fields.*/
-+#define USB_RST (1<<31) /* Reset USB modules */
-+#define USB_ENA (1<<30) /* Enable USB modules*/
-+#define USB_SUSPEND (1<<29) /* Suspend USB modules */
-+#define USB_ENDIAN (1<<28) /* Endian of USB modules */
-+#define USB_POWER (1<<0) /* Power mode of USB modules */
-+
-+
-+#define SPI1_RXDATA __REG(IMX_SPI1_BASE + 0x0)
-+#define SPI1_TXDATA __REG(IMX_SPI1_BASE + 0x4)
-+#define SPI1_CONTROL __REG(IMX_SPI1_BASE + 0x8)
-+#define SPI1_INT __REG(IMX_SPI1_BASE + 0xC)
-+#define SPI1_TEST __REG(IMX_SPI1_BASE + 0x10)
-+#define SPI1_PERIOD __REG(IMX_SPI1_BASE + 0x14)
-+#define SPI1_DMA __REG(IMX_SPI1_BASE + 0x18)
-+#define SPI1_RESET __REG(IMX_SPI1_BASE + 0x1C)
-+
#endif // _IMX_REGS_H
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/031-armadeus-imx_udc_add_usb_h_include_to_arch_arm_mach-imx_include_mach.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/031-armadeus-imx_udc_add_usb_h_include_to_arch_arm_mach-imx_include_mach.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/031-armadeus-imx_udc_add_usb_h_include_to_arch_arm_mach-imx_include_mach.patch 2009-05-01 12:15:24 UTC (rev 1251)
@@ -0,0 +1,31 @@
+This patch is needed until MX1 architecture is integrated in
+plat-mcx (2.6.31 ?).
+
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/usb.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/usb.h 2009-05-01 13:51:56.000000000 +0200
+@@ -0,0 +1,23 @@
++/*
++ * Copyright (C) 2008 Darius Augulis <aug...@gm...>
++ *
++ * 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.
++ */
++
++#ifndef __ASM_ARCH_MXC_USB
++#define __ASM_ARCH_MXC_USB
++
++struct imxusb_platform_data {
++ int (*init)(struct device *);
++ int (*exit)(struct device *);
++};
++
++#endif /* __ASM_ARCH_MXC_USB */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1250
http://armadeus.svn.sourceforge.net/armadeus/?rev=1250&view=rev
Author: artemys
Date: 2009-05-01 11:45:49 +0000 (Fri, 01 May 2009)
Log Message:
-----------
[LINUX] Removes unneeded patch for imx_udc (2.6.29)
Removed Paths:
-------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-imx_udc-add_driver_to_linux_build_system.patch
Deleted: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-imx_udc-add_driver_to_linux_build_system.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-imx_udc-add_driver_to_linux_build_system.patch 2009-05-01 09:52:46 UTC (rev 1249)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/030-armadeus-imx_udc-add_driver_to_linux_build_system.patch 2009-05-01 11:45:49 UTC (rev 1250)
@@ -1,32 +0,0 @@
-Index: linux-2.6.29/drivers/usb/gadget/Kconfig
-===================================================================
---- linux-2.6.29.orig/drivers/usb/gadget/Kconfig 2009-03-24 00:12:14.000000000 +0100
-+++ linux-2.6.29/drivers/usb/gadget/Kconfig 2009-03-30 10:55:52.000000000 +0200
-@@ -439,6 +439,27 @@
- default USB_GADGET
- select USB_GADGET_SELECTED
-
-+config USB_GADGET_IMX
-+ boolean "i.MX: MX1, MXL"
-+ depends on ARCH_IMX
-+ help
-+ Freescale's i.MX series include an integrated full speed
-+ USB 1.1 device controller. The controllers in the i.MX series
-+ are register-compatible.
-+
-+ It has Six fixed-function endpoints, as well as endpoint
-+ zero (for control transfers).
-+
-+ Say "y" to link the driver statically, or "m" to build a
-+ dynamically linked module called "imx_udc" and force all
-+ gadget drivers to also be dynamically linked.
-+
-+config USB_IMX
-+ tristate
-+ depends on USB_GADGET_IMX
-+ default USB_GADGET
-+ select USB_GADGET_SELECTED
-+
- config USB_GADGET_GOKU
- boolean "Toshiba TC86C001 'Goku-S'"
- depends on PCI
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-05-01 09:53:01
|
Revision: 1249
http://armadeus.svn.sourceforge.net/armadeus/?rev=1249&view=rev
Author: artemys
Date: 2009-05-01 09:52:46 +0000 (Fri, 01 May 2009)
Log Message:
-----------
[LINUX] Cleanup apf9328 (2.6.27 & 2.6.29) + merge PWM
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-04-30 21:34:55 UTC (rev 1248)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-05-01 09:52:46 UTC (rev 1249)
@@ -1,8 +1,10 @@
PATCH AUTOMATICALLY GENERATED
DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328.c
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328.c
+Index: linux-2.6.27.13/arch/arm/mach-imx/apf9328.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.27.13/arch/arm/mach-imx/apf9328.c 2009-05-01 11:35:22.000000000 +0200
@@ -0,0 +1,762 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
@@ -79,7 +81,7 @@
+#define CONFIG_PWM
+#endif
+
-+// --- ISP1761
++/* --- ISP1761 */
+#ifdef CONFIG_ARMADEUS_ISP1761
+
+static void apf_isp116x_delay(struct device *dev, int delay)
@@ -127,7 +129,7 @@
+ .id = 0,
+ .num_resources = ARRAY_SIZE(devfull_isp1761_resources),
+ .resource = devfull_isp1761_resources,
-+ .dev = { .platform_data = &isp116x_pdata, },
++ .dev = { .platform_data = &isp116x_pdata, },
+};
+
+/*static struct platform_device *devfull_isp1761_devices[] = {
@@ -136,57 +138,56 @@
+
+#endif
+
-+// --- ETHERNET RESSOURCE ---
++/* --- ETHERNET RESSOURCE --- */
+#ifdef CONFIG_DM9000
+static struct resource dm9000_resources[] = {
-+ [0] = {
-+ .start = (APF9328_ETH_PHYS + 0),
-+ .end = (APF9328_ETH_PHYS + 1),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (APF9328_ETH_PHYS + 2),
-+ .end = (APF9328_ETH_PHYS + 3),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = (APF9328_ETH_IRQ),
-+ .end = (APF9328_ETH_IRQ),
-+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
-+ },
++ [0] = {
++ .start = (APF9328_ETH_PHYS + 0),
++ .end = (APF9328_ETH_PHYS + 1),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = (APF9328_ETH_PHYS + 2),
++ .end = (APF9328_ETH_PHYS + 3),
++ .flags = IORESOURCE_MEM,
++ },
++ [2] = {
++ .start = (APF9328_ETH_IRQ),
++ .end = (APF9328_ETH_IRQ),
++ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
++ },
+};
+
+static struct dm9000_plat_data dm9000_setup = {
-+ .flags = DM9000_PLATF_16BITONLY
++ .flags = DM9000_PLATF_16BITONLY
+};
+
+static struct platform_device dm9000x_device = {
-+ .name = "dm9000",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(dm9000_resources),
-+ .resource = dm9000_resources,
-+ .dev = { .platform_data = &dm9000_setup, },
++ .name = "dm9000",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(dm9000_resources),
++ .resource = dm9000_resources,
++ .dev = { .platform_data = &dm9000_setup, },
+};
-+#endif // CONFIG_DM9000
++#endif /* CONFIG_DM9000 */
+
+
++#ifdef CONFIG_PWM
+static struct resource pwm_resources[] = {
-+ [0] = {
-+ .start = (IMX_PWM_BASE),
-+ .end = (IMX_PWM_BASE + 0x0C),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (PWM_INT),
-+ .end = (PWM_INT),
-+ .flags = IORESOURCE_IRQ,
-+ },
++ [0] = {
++ .start = (IMX_PWM_BASE),
++ .end = (IMX_PWM_BASE + 0x0C),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = (PWM_INT),
++ .end = (PWM_INT),
++ .flags = IORESOURCE_IRQ,
++ },
+};
+
-+#ifdef CONFIG_PWM
+static int apf9328_pwm_0_init(void)
+{
-+ printk("setup gpio \n");
+ /* Init Port PA[2] : PWMO*/
+ DDIR(0) |= 0x00000002;
+ GIUS(0) &= ~0x00000002;
@@ -205,19 +206,18 @@
+};
+
+static struct platform_device imx_pwm_device = {
-+ .name = "imx-pwm", // Should be the same as the driver name
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(pwm_resources),
-+ .resource = pwm_resources,
-+ .dev = {
-+ .platform_data = &apf9328_pwm_0_data,
-+ }
++ .name = "imx-pwm",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(pwm_resources),
++ .resource = pwm_resources,
++ .dev = {
++ .platform_data = &apf9328_pwm_0_data,
++ }
+};
+
-+#endif
++#endif /* CONFIG_PWM */
+
+
-+
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+int apf9328_ssi_gpio_init(struct platform_device *pdev)
+{
@@ -304,27 +304,27 @@
+#endif /* defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE) */
+
+
-+// --- SERIAL RESSOURCE ---
++/* --- SERIAL RESSOURCE --- */
+static struct imxuart_platform_data uart_pdata = {
-+ .flags = IMXUART_HAVE_RTSCTS,
++ .flags = IMXUART_HAVE_RTSCTS,
+};
+
+static struct resource imx_uart1_resources[] = {
-+ [0] = {
-+ .start = 0x00206000,
-+ .end = 0x002060FF,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (UART1_MINT_RX),
-+ .end = (UART1_MINT_RX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = (UART1_MINT_TX),
-+ .end = (UART1_MINT_TX),
-+ .flags = IORESOURCE_IRQ,
++ [0] = {
++ .start = 0x00206000,
++ .end = 0x002060FF,
++ .flags = IORESOURCE_MEM,
+ },
++ [1] = {
++ .start = (UART1_MINT_RX),
++ .end = (UART1_MINT_RX),
++ .flags = IORESOURCE_IRQ,
++ },
++ [2] = {
++ .start = (UART1_MINT_TX),
++ .end = (UART1_MINT_TX),
++ .flags = IORESOURCE_IRQ,
++ },
+ [3] = { /* Mandatory (even if RTS is not used), otherwise drivers/serial/imx.c fails to allocate IRQs */
+ .start = UART1_MINT_RTS,
+ .end = UART1_MINT_RTS,
@@ -333,13 +333,13 @@
+};
+
+static struct platform_device imx_uart1_device = {
-+ .name = "imx-uart",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(imx_uart1_resources),
-+ .resource = imx_uart1_resources,
-+ .dev = {
-+ .platform_data = &uart_pdata,
-+ }
++ .name = "imx-uart",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(imx_uart1_resources),
++ .resource = imx_uart1_resources,
++ .dev = {
++ .platform_data = &uart_pdata,
++ }
+};
+
+static struct resource imx_uart2_resources[] = {
@@ -366,13 +366,13 @@
+};
+
+static struct platform_device imx_uart2_device = {
-+ .name = "imx-uart",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(imx_uart2_resources),
-+ .resource = imx_uart2_resources,
-+ .dev = {
-+ .platform_data = &uart_pdata,
-+ }
++ .name = "imx-uart",
++ .id = 1,
++ .num_resources = ARRAY_SIZE(imx_uart2_resources),
++ .resource = imx_uart2_resources,
++ .dev = {
++ .platform_data = &uart_pdata,
++ }
+};
+
+#ifdef CONFIG_SPI_IMX
@@ -395,12 +395,12 @@
+};
+
+static struct platform_device imx_spi1 = {
-+ .name = "spi_imx",
-+ .id = 1,
-+ .resource = imx_spi1_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi1_resource),
++ .name = "spi_imx",
++ .id = 1,
++ .resource = imx_spi1_resource,
++ .num_resources = ARRAY_SIZE(imx_spi1_resource),
+ .dev = {
-+ .platform_data = &imx_spi1_master_info,
++ .platform_data = &imx_spi1_master_info,
+ },
+};
+
@@ -423,17 +423,18 @@
+};
+
+static struct platform_device imx_spi2 = {
-+ .name = "spi_imx",
-+ .id = 2,
-+ .resource = imx_spi2_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi2_resource),
++ .name = "spi_imx",
++ .id = 2,
++ .resource = imx_spi2_resource,
++ .num_resources = ARRAY_SIZE(imx_spi2_resource),
+ .dev = {
-+ .platform_data = &imx_spi2_master_info,
++ .platform_data = &imx_spi2_master_info,
+ },
+};
+
-+#endif //CONFIG_SPI_IMX
++#endif /* CONFIG_SPI_IMX */
+
++
+#ifdef CONFIG_ARMADEUS_MAX1027
+#define IMX_SPI1_SS_PIN 15
+#define IMX_SPI1_SS (1<<15)
@@ -442,35 +443,35 @@
+
+static int max1027_init(struct spi_device *spi)
+{
-+ imx_gpio_mode( PC14_PF_SPI1_SCLK );
-+ imx_gpio_mode( PC16_PF_SPI1_MISO );
-+ imx_gpio_mode( PC17_PF_SPI1_MOSI );
++ imx_gpio_mode( PC14_PF_SPI1_SCLK );
++ imx_gpio_mode( PC16_PF_SPI1_MISO );
++ imx_gpio_mode( PC17_PF_SPI1_MOSI );
+
-+ /* configure CNVST */
-+ DR(0) |= 1 << MAX1027_CNVST; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* configure CNVST */
++ DR(0) |= 1 << MAX1027_CNVST; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ /* configure EOC */
-+ imx_gpio_mode( GPIO_PORTA | MAX1027_EOC_INT | GPIO_IN | GPIO_GIUS );
++ /* configure EOC */
++ imx_gpio_mode( GPIO_PORTA | MAX1027_EOC_INT | GPIO_IN | GPIO_GIUS );
+
-+ /* SPI CSn is used as chip select but in GPIO mode */
-+ DR(2) |= IMX_SPI1_SS;
-+ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* SPI CSn is used as chip select but in GPIO mode */
++ DR(2) |= IMX_SPI1_SS;
++ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ return 0;
++ return 0;
+}
+
+static int max1027_exit(struct spi_device *spi)
+{
-+ return 0;
++ return 0;
+}
+
+static void max1027_cs(u32 command)
+{
-+ if( command == SPI_CS_DEASSERT )
-+ DR(2) |= IMX_SPI1_SS;
-+ else
-+ DR(2) &= ~IMX_SPI1_SS;
++ if (command == SPI_CS_DEASSERT)
++ DR(2) |= IMX_SPI1_SS;
++ else
++ DR(2) &= ~IMX_SPI1_SS;
+}
+
+static struct spi_imx_chip max1027_hw = {
@@ -481,55 +482,54 @@
+ .conv = MAX1027_CONV_DEFAULT,
+ .setup = MAX1027_SETUP_DEFAULT,
+ .avg = MAX1027_AVG_DEFAULT,
-+ .cnvst_pin = (int)(MAX1027_CNVST|GPIO_PORTA),
++ .cnvst_pin = (int)(MAX1027_CNVST|GPIO_PORTA),
+ .init = max1027_init,
+ .exit = max1027_exit
+};
+
++#endif /* CONFIG_ARMADEUS_MAX1027 */
+
+
-+#endif // CONFIG_ARMADEUS_MAX1027
-+
+#ifdef CONFIG_SPI_TSC2102
+#define TSC2102_CS_GPIOB 17
+#define TSC2102_INT_GPIOD 8
+
+static int tsc2102_init_gpio(void)
+{
-+ // Activate SPI2 port ----
-+ // PortB 17 is used as chip select (in GPIO mode)
-+ DR(1) |= 1 << TSC2102_CS_GPIOB; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTB | TSC2102_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
-+ // Configure SPI2 outputs
-+ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
-+ imx_gpio_mode( PD10_AIN_SPI2_TXD );
-+ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
-+ FMCR |= SPI2_RXD_SEL; // RX is AOUT on PORTD
++ /* Activate SPI2 port ---- */
++ /* PortB 17 is used as chip select (in GPIO mode) */
++ DR(1) |= 1 << TSC2102_CS_GPIOB; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTB | TSC2102_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* Configure SPI2 outputs */
++ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
++ imx_gpio_mode( PD10_AIN_SPI2_TXD );
++ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
++ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
+
-+ // PortD 8 is used as PINTDAV interrupt
-+ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
-+ //imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );
++ /* PortD 8 is used as PINTDAV interrupt */
++ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
++ /*imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );*/
+
-+ printk("TSC2102 GPIOs initialized\n");
-+ return 0;
++ printk("TSC2102 GPIOs initialized\n");
++ return 0;
+}
+
-+// Chip select command for TSC2102
++/* Chip select command for TSC2102 */
+static void tsc2102_cs(u32 command)
+{
-+ // PortB 19 is used as chip select
-+ if( command == SPI_CS_DEASSERT )
-+ DR(1) |= 1<< TSC2102_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< TSC2102_CS_GPIOB);
++ /* PortB 19 is used as chip select */
++ if( command == SPI_CS_DEASSERT )
++ DR(1) |= 1<< TSC2102_CS_GPIOB;
++ else
++ DR(1) &= ~(1<< TSC2102_CS_GPIOB);
+}
+
+static struct spi_imx_chip tsc2102_hw = {
-+ .cs_control = tsc2102_cs,
++ .cs_control = tsc2102_cs,
+};
+
+static struct tsc210x_config apf9328_tsc2102_config = {
-+ .use_internal = 1, // -> use internal voltage reference
++ .use_internal = 1, /* -> use internal voltage reference */
+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
+ .init = tsc2102_init_gpio,
+/* .apm_report = palmte_get_power_status,*/
@@ -538,132 +538,134 @@
+#endif*/
+};
+
-+#endif // CONFIG_SPI_TSC2102
++#endif /* CONFIG_SPI_TSC2102 */
+
++
+#ifdef CONFIG_CAN_MCP251X
+#define CAN_MPC251X_CS_GPIOB 19
+#define CAN_MPC251X_INT_GPIOC 13
+
-+// Chip select command for MCP251X
++/* Chip select command for MCP251X */
+static void mcp251X_cs(u32 command)
+{
-+ // PortB 19 is used as chip select
-+ if( command == SPI_CS_DEASSERT )
-+ DR(1) |= 1<< CAN_MPC251X_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< CAN_MPC251X_CS_GPIOB);
++ /* PortB 19 is used as chip select */
++ if (command == SPI_CS_DEASSERT)
++ DR(1) |= 1<< CAN_MPC251X_CS_GPIOB;
++ else
++ DR(1) &= ~(1<< CAN_MPC251X_CS_GPIOB);
+}
+
+static struct spi_imx_chip mcp251X_hw = {
-+ .cs_control = mcp251X_cs,
++ .cs_control = mcp251X_cs,
+};
+
+static void mcp251X_init_gpio(void)
+{
-+ // Activate SPI2 port ----
-+ // PortB 19 is used as chip select (in GPIO mode)
-+ DR(1) |= 1 << CAN_MPC251X_CS_GPIOB; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* Activate SPI2 port ---- */
++ /* PortB 19 is used as chip select (in GPIO mode) */
++ DR(1) |= 1 << CAN_MPC251X_CS_GPIOB; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ // PortC 13 is used as CAN interrupt
-+ imx_gpio_mode( GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS );
++ /* PortC 13 is used as CAN interrupt */
++ imx_gpio_mode( GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS );
+
-+ // Configure SPI2 outputs
-+ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
-+ imx_gpio_mode( PD10_AIN_SPI2_TXD );
-+ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
-+ FMCR |= SPI2_RXD_SEL; // RX is AOUT on PORTD
++ /* Configure SPI2 outputs */
++ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
++ imx_gpio_mode( PD10_AIN_SPI2_TXD );
++ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
++ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
+}
+
+static struct mcp251x_platform_data apf9328_mcp251x_config = {
-+ .oscillator_frequency = 16000000,
-+ .board_specific_setup = NULL,
-+ .device_reset = NULL,
-+ .transceiver_enable = NULL,
++ .oscillator_frequency = 16000000,
++ .board_specific_setup = NULL,
++ .device_reset = NULL,
++ .transceiver_enable = NULL,
+};
+
-+#endif // CONFIG_CAN_MCP251X
++#endif /* CONFIG_CAN_MCP251X */
+
+
+static struct spi_board_info spi_board_info[] __initdata = {
+#ifdef CONFIG_ARMADEUS_MAX1027
+{
-+ .modalias = "max1027",
-+ .controller_data = &max1027_hw,
-+ .max_speed_hz = 8000000,
-+ .bus_num = 1, // SPI1
-+ .chip_select = 0,
-+ .mode = 0,
-+ .irq = IRQ_GPIOA(MAX1027_EOC_INT),
-+ .platform_data = &apf9328_max1027_config,
++ .modalias = "max1027",
++ .controller_data= &max1027_hw,
++ .max_speed_hz = 8000000,
++ .bus_num = 1, /* SPI1 */
++ .chip_select = 0,
++ .mode = 0,
++ .irq = IRQ_GPIOA(MAX1027_EOC_INT),
++ .platform_data = &apf9328_max1027_config,
+},
-+#endif // CONFIG_SENSORS_MAX1027
++#endif
+#ifdef CONFIG_SPI_TSC2102
+{
-+ .modalias = "tsc210x",
-+ .controller_data = &tsc2102_hw,
-+ .max_speed_hz = 8000000,
-+ .bus_num = 2, // SPI2
-+ .irq = IRQ_GPIOD(TSC2102_INT_GPIOD),
-+ .chip_select = 0,
-+ .mode = 0,
-+ .platform_data = &apf9328_tsc2102_config,
++ .modalias = "tsc210x",
++ .controller_data= &tsc2102_hw,
++ .max_speed_hz = 8000000,
++ .bus_num = 2, /* SPI2 */
++ .irq = IRQ_GPIOD(TSC2102_INT_GPIOD),
++ .chip_select = 0,
++ .mode = 0,
++ .platform_data = &apf9328_tsc2102_config,
+},
-+#endif // CONFIG_SPI_TSC2102
++#endif
+#ifdef CONFIG_CAN_MCP251X
-+ {
-+ .modalias = "mcp251x",
-+ .max_speed_hz = 8000000, /* 8MHz */
-+ .controller_data = &mcp251X_hw,
-+ .bus_num = 2,
-+ .mode = SPI_MODE_0,
-+ .chip_select = 1,
-+ .irq = IRQ_GPIOC( CAN_MPC251X_INT_GPIOC ),
-+ .platform_data = &apf9328_mcp251x_config,
-+ },
-+#endif // CONFIG_CAN_MCP251X
++{
++ .modalias = "mcp251x",
++ .max_speed_hz = 8000000, /* 8MHz */
++ .controller_data= &mcp251X_hw,
++ .bus_num = 2,
++ .mode = SPI_MODE_0,
++ .chip_select = 1,
++ .irq = IRQ_GPIOC( CAN_MPC251X_INT_GPIOC ),
++ .platform_data = &apf9328_mcp251x_config,
++},
++#endif
+};
+
-+// --- LCD RESSOURCE ---
++/* --- LCD RESSOURCE --- */
+#ifdef CONFIG_FB_IMX
-+// all custom LCD configuration is deported to this file for clarity purpose:
++/* all custom LCD configuration is deported to this file for clarity purpose: */
+#include "apf9328_lcd_config.h"
+#define IMX_FB_PHYS (0x0C000000 - 0x40000)
-+#endif // CONFIG_FB_IMX
++#endif
+
+#ifdef CONFIG_IMX_BACKLIGHT
+static struct imxbl_machinfo imx_bl_machinfo = {
-+ .max_intensity = 0xff,
-+ .default_intensity = 0x90,
-+ .limit_mask = 0x7f, // When battery is low
-+// set_bl_intensity = put a function here if you want to overload default one,
++ .max_intensity = 0xff,
++ .default_intensity = 0x90,
++ .limit_mask = 0x7f, /* When battery is low */
++/* set_bl_intensity = put a function here if you want to overload default one, */
+};
-+//extern struct platform_device imxfb_device; // filled in generic.c
++
+static struct platform_device imxbl_device = {
-+ .name = "imx-bl",
-+ .dev = {
-+// .parent = &imxfb_device.dev, crash kernel even if EXPORT_SYMBOL() is done in generic.c
-+ .platform_data = &imx_bl_machinfo,
-+ },
-+ .id = 0,
++ .name = "imx-bl",
++ .dev = {
++ // .parent = &imxfb_device.dev, crash kernel even if EXPORT_SYMBOL() is done in generic.c
++ .platform_data = &imx_bl_machinfo,
++ },
++ .id = 0,
+};
-+#endif // CONFIG_IMX_BACKLIGHT
++#endif /* CONFIG_IMX_BACKLIGHT */
+
++
+static struct platform_device *devices[] __initdata = {
-+ &imx_uart1_device,
-+ &imx_uart2_device,
++ &imx_uart1_device,
++ &imx_uart2_device,
+#ifdef CONFIG_DM9000
-+ &dm9000x_device,
++ &dm9000x_device,
+#endif
+#ifdef CONFIG_SPI_IMX
-+ &imx_spi1,
-+ &imx_spi2,
++ &imx_spi1,
++ &imx_spi2,
+#endif
+#ifdef CONFIG_PWM
-+ &imx_pwm_device,
++ &imx_pwm_device,
+#endif
+#ifdef CONFIG_IMX_BACKLIGHT
-+ &imxbl_device,
++ &imxbl_device,
+#endif
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+ &tsc2102_alsa_device,
@@ -676,9 +678,9 @@
+
+static void __init apf9328_init(void)
+{
-+ printk("--- Registering APF9328 ressources\n");
++ printk("--- Registering APF9328 ressources\n");
+
-+ // Serial
++ /* Serial */
+ imx_gpio_mode(PC9_PF_UART1_CTS);
+ imx_gpio_mode(PC10_PF_UART1_RTS);
+ imx_gpio_mode(PC11_PF_UART1_TXD);
@@ -690,23 +692,23 @@
+ imx_gpio_mode( PB29_PF_UART2_RTS );
+
+#ifdef CONFIG_FB_IMX /* LCD */
-+ set_imx_fb_info(&apf9328_fb_info);
-+ imx_fb_set_gpios(); /* init PORTD ....*/
++ set_imx_fb_info(&apf9328_fb_info);
++ imx_fb_set_gpios(); /* init PORTD ....*/
+#endif
+#ifdef CONFIG_CAN_MCP251X
-+ mcp251X_init_gpio();
++ mcp251X_init_gpio();
+#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
+ imx_gpio_mode( ISP1761_GPIO_IRQ | GPIO_IN | GPIO_GIUS ); /* Set up IRQ line. */
-+#endif // CONFIG_ARMADEUS_ISP1761
++#endif
+
-+ platform_add_devices(devices, ARRAY_SIZE(devices));
++ platform_add_devices(devices, ARRAY_SIZE(devices));
+
+#if defined (CONFIG_ARMADEUS_MAX1027) || defined (CONFIG_SPI_TSC2102) || defined (CONFIG_CAN_MCP251X)
-+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
++ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+#endif
+
-+ printk("--- APF9328 ressources registered\n");
++ printk("--- APF9328 ressources registered\n");
+}
+
+/*
@@ -715,62 +717,61 @@
+ */
+static struct map_desc apf9328_io_desc[] __initdata = {
+#ifdef CONFIG_FB_IMX
-+ {
-+ .virtual = IMX_FB_VIRT,
-+ .pfn = __phys_to_pfn(IMX_FB_PHYS),
-+ .length = IMX_FB_SIZE,
-+ .type = MT_DEVICE
-+ },
-+#endif // CONFIG_FB_IMX
-+ // FPGA Memory mapping
-+ {.virtual = IMX_CS1_VIRT, .pfn = __phys_to_pfn(IMX_CS1_PHYS), .length = IMX_CS1_SIZE, .type = MT_DEVICE},
++ {
++ .virtual = IMX_FB_VIRT,
++ .pfn = __phys_to_pfn(IMX_FB_PHYS),
++ .length = IMX_FB_SIZE,
++ .type = MT_DEVICE
++ },
++#endif
++ /* FPGA Memory mapping */
++ {.virtual = IMX_CS1_VIRT, .pfn = __phys_to_pfn(IMX_CS1_PHYS), .length = IMX_CS1_SIZE, .type = MT_DEVICE},
+};
+
+void __init apf9328_map_io(void)
+{
-+ imx_map_io();
-+ iotable_init(apf9328_io_desc, ARRAY_SIZE(apf9328_io_desc));
++ imx_map_io();
++ iotable_init(apf9328_io_desc, ARRAY_SIZE(apf9328_io_desc));
+}
+
+static void __init apf9328_init_irq(void)
+{
-+ // Init generic IRQs
-+ imx_init_irq();
++ /* Init generic IRQs */
++ imx_init_irq();
+
-+ // Init our custom IRQs
++ /* Init our custom IRQs */
+#ifdef CONFIG_DM9000
-+ set_irq_type(APF9328_ETH_IRQ, IRQF_TRIGGER_FALLING);
++ set_irq_type(APF9328_ETH_IRQ, IRQF_TRIGGER_FALLING);
+#endif
+#ifdef CONFIG_SPI_TSC2102
-+ set_irq_type( IRQ_GPIOD(TSC2102_INT_GPIOD), IRQF_TRIGGER_FALLING );
++ set_irq_type( IRQ_GPIOD(TSC2102_INT_GPIOD), IRQF_TRIGGER_FALLING );
+#endif
+#ifdef CONFIG_CAN_MCP251X
-+ set_irq_type( IRQ_GPIOC(CAN_MPC251X_INT_GPIOC), IRQF_TRIGGER_FALLING );
++ set_irq_type( IRQ_GPIOC(CAN_MPC251X_INT_GPIOC), IRQF_TRIGGER_FALLING );
+#endif
+#ifdef CONFIG_ARMADEUS_FPGA_DRIVERS
-+ set_irq_type( APF9328_FPGA_IRQ, IRQF_TRIGGER_RISING );
++ set_irq_type( APF9328_FPGA_IRQ, IRQF_TRIGGER_RISING );
+#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
-+ set_irq_type( ISP1761_IRQ, IRQF_TRIGGER_FALLING );
-+#endif // CONFIG_ARMADEUS_ISP1761
++ set_irq_type( ISP1761_IRQ, IRQF_TRIGGER_FALLING );
++#endif
+}
+
+
+MACHINE_START(APF9328, "Armadeus APF9328")
-+ /* Maintainer: Julien Boibessot, Armadeus */
-+ .phys_io = 0x00200000,
-+ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
-+ .boot_params = 0x08000100,
-+ .map_io = apf9328_map_io,
-+ .init_irq = apf9328_init_irq,
-+ .timer = &imx_timer,
-+ .init_machine = apf9328_init,
++ /* Maintainer: Julien Boibessot, Armadeus */
++ .phys_io = 0x00200000,
++ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
++ .boot_params = 0x08000100,
++ .map_io = apf9328_map_io,
++ .init_irq = apf9328_init_irq,
++ .timer = &imx_timer,
++ .init_machine = apf9328_init,
+MACHINE_END
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328_lcd_config.h
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328_lcd_config.h
+Index: linux-2.6.27.13/arch/arm/mach-imx/apf9328_lcd_config.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.27.13/arch/arm/mach-imx/apf9328_lcd_config.h 2009-05-01 10:34:16.000000000 +0200
@@ -0,0 +1,193 @@
+/*
+ *
@@ -965,11 +966,10 @@
+#endif // CONFIG_FB_IMX
+
+#endif // APF9328_LCD_CONFIG_H
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/include/mach/apf9328.h
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/include/mach/apf9328.h
+Index: linux-2.6.27.13/arch/arm/mach-imx/include/mach/apf9328.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.27.13/arch/arm/mach-imx/include/mach/apf9328.h 2009-05-01 10:34:16.000000000 +0200
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-04-30 21:34:55 UTC (rev 1248)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-05-01 09:52:46 UTC (rev 1249)
@@ -4,8 +4,8 @@
Index: linux-2.6.29/arch/arm/mach-imx/apf9328.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29/arch/arm/mach-imx/apf9328.c 2009-04-30 16:33:54.000000000 +0200
-@@ -0,0 +1,758 @@
++++ linux-2.6.29/arch/arm/mach-imx/apf9328.c 2009-05-01 11:35:08.000000000 +0200
+@@ -0,0 +1,788 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -54,7 +54,7 @@
+#include <linux/spi/max1027.h>
+#include <linux/usb/isp116x.h>
+#include <mach/imx_ssi.h>
-+
++#include "../../../drivers/armadeus/pwm/pwm.h"
+#ifdef CONFIG_DM9000
+#include <linux/dm9000.h>
+#endif
@@ -79,8 +79,11 @@
+#ifdef CONFIG_ARMADEUS_ISP1761_MODULE
+#define CONFIG_ARMADEUS_ISP1761 1
+#endif
++#ifdef CONFIG_ARMADEUS_PWM_DRIVER_MODULE
++#define CONFIG_PWM
++#endif
+
-+// --- ISP1761
++/* --- ISP1761 */
+#ifdef CONFIG_ARMADEUS_ISP1761
+
+static void apf_isp116x_delay(struct device *dev, int delay)
@@ -128,7 +131,7 @@
+ .id = 0,
+ .num_resources = ARRAY_SIZE(devfull_isp1761_resources),
+ .resource = devfull_isp1761_resources,
-+ .dev = { .platform_data = &isp116x_pdata, },
++ .dev = { .platform_data = &isp116x_pdata, },
+};
+
+/*static struct platform_device *devfull_isp1761_devices[] = {
@@ -137,61 +140,86 @@
+
+#endif
+
-+// --- ETHERNET RESSOURCE ---
++/* --- ETHERNET RESSOURCE --- */
+#ifdef CONFIG_DM9000
+static struct resource dm9000_resources[] = {
-+ [0] = {
-+ .start = (APF9328_ETH_PHYS + 0),
-+ .end = (APF9328_ETH_PHYS + 1),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (APF9328_ETH_PHYS + 2),
-+ .end = (APF9328_ETH_PHYS + 3),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = (APF9328_ETH_IRQ),
-+ .end = (APF9328_ETH_IRQ),
-+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
-+ },
++ [0] = {
++ .start = (APF9328_ETH_PHYS + 0),
++ .end = (APF9328_ETH_PHYS + 1),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = (APF9328_ETH_PHYS + 2),
++ .end = (APF9328_ETH_PHYS + 3),
++ .flags = IORESOURCE_MEM,
++ },
++ [2] = {
++ .start = (APF9328_ETH_IRQ),
++ .end = (APF9328_ETH_IRQ),
++ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
++ },
+};
+
+static struct dm9000_plat_data dm9000_setup = {
-+ .flags = DM9000_PLATF_16BITONLY
++ .flags = DM9000_PLATF_16BITONLY
+};
+
+static struct platform_device dm9000x_device = {
-+ .name = "dm9000",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(dm9000_resources),
-+ .resource = dm9000_resources,
-+ .dev = { .platform_data = &dm9000_setup, },
++ .name = "dm9000",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(dm9000_resources),
++ .resource = dm9000_resources,
++ .dev = { .platform_data = &dm9000_setup, },
+};
-+#endif // CONFIG_DM9000
++#endif /* CONFIG_DM9000 */
+
-+// --- PWM RESSOURCE ---
-+// I don't think it needs an ifdef - JB
++
++#ifdef CONFIG_PWM
+static struct resource pwm_resources[] = {
-+ [0] = {
-+ .start = (IMX_PWM_BASE),
-+ .end = (IMX_PWM_BASE + 0x0C),
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (PWM_INT),
-+ .end = (PWM_INT),
-+ .flags = IORESOURCE_IRQ,
-+ },
++ [0] = {
++ .start = (IMX_PWM_BASE),
++ .end = (IMX_PWM_BASE + 0x0C),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = (PWM_INT),
++ .end = (PWM_INT),
++ .flags = IORESOURCE_IRQ,
++ },
+};
+
++static int apf9328_pwm_0_init(void)
++{
++ /* Init Port PA[2] : PWMO*/
++ DDIR(0) |= 0x00000002;
++ GIUS(0) &= ~0x00000002;
++ GPR(0) &= ~0x00000002;
++ return 0;
++}
++
++static int apf9328_pwm_0_exit(void)
++{
++ return 0;
++}
++
++static struct imx_pwm_platform_data apf9328_pwm_0_data = {
++ .init = apf9328_pwm_0_init,
++ .exit = apf9328_pwm_0_exit,
++};
++
+static struct platform_device imx_pwm_device = {
-+ .name = "imx-pwm", // Should be the same as the driver name
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(pwm_resources),
-+ .resource = pwm_resources,
++ .name = "imx-pwm",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(pwm_resources),
++ .resource = pwm_resources,
++ .dev = {
++ .platform_data = &apf9328_pwm_0_data,
++ }
+};
+
++#endif /* CONFIG_PWM */
++
++
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+int apf9328_ssi_gpio_init(struct platform_device *pdev)
+{
@@ -278,27 +306,27 @@
+#endif /* defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE) */
+
+
-+// --- SERIAL RESSOURCE ---
++/* --- SERIAL RESSOURCE --- */
+static struct imxuart_platform_data uart_pdata = {
-+ .flags = IMXUART_HAVE_RTSCTS,
++ .flags = IMXUART_HAVE_RTSCTS,
+};
+
+static struct resource imx_uart1_resources[] = {
-+ [0] = {
-+ .start = 0x00206000,
-+ .end = 0x002060FF,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (UART1_MINT_RX),
-+ .end = (UART1_MINT_RX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = (UART1_MINT_TX),
-+ .end = (UART1_MINT_TX),
-+ .flags = IORESOURCE_IRQ,
++ [0] = {
++ .start = 0x00206000,
++ .end = 0x002060FF,
++ .flags = IORESOURCE_MEM,
+ },
++ [1] = {
++ .start = (UART1_MINT_RX),
++ .end = (UART1_MINT_RX),
++ .flags = IORESOURCE_IRQ,
++ },
++ [2] = {
++ .start = (UART1_MINT_TX),
++ .end = (UART1_MINT_TX),
++ .flags = IORESOURCE_IRQ,
++ },
+ [3] = { /* Mandatory (even if RTS is not used), otherwise drivers/serial/imx.c fails to allocate IRQs */
+ .start = UART1_MINT_RTS,
+ .end = UART1_MINT_RTS,
@@ -307,13 +335,13 @@
+};
+
+static struct platform_device imx_uart1_device = {
-+ .name = "imx-uart",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(imx_uart1_resources),
-+ .resource = imx_uart1_resources,
-+ .dev = {
-+ .platform_data = &uart_pdata,
-+ }
++ .name = "imx-uart",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(imx_uart1_resources),
++ .resource = imx_uart1_resources,
++ .dev = {
++ .platform_data = &uart_pdata,
++ }
+};
+
+static struct resource imx_uart2_resources[] = {
@@ -340,13 +368,13 @@
+};
+
+static struct platform_device imx_uart2_device = {
-+ .name = "imx-uart",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(imx_uart2_resources),
-+ .resource = imx_uart2_resources,
-+ .dev = {
-+ .platform_data = &uart_pdata,
-+ }
++ .name = "imx-uart",
++ .id = 1,
++ .num_resources = ARRAY_SIZE(imx_uart2_resources),
++ .resource = imx_uart2_resources,
++ .dev = {
++ .platform_data = &uart_pdata,
++ }
+};
+
+#ifdef CONFIG_SPI_IMX
@@ -369,12 +397,12 @@
+};
+
+static struct platform_device imx_spi1 = {
-+ .name = "spi_imx",
-+ .id = 1,
-+ .resource = imx_spi1_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi1_resource),
++ .name = "spi_imx",
++ .id = 1,
++ .resource = imx_spi1_resource,
++ .num_resources = ARRAY_SIZE(imx_spi1_resource),
+ .dev = {
-+ .platform_data = &imx_spi1_master_info,
++ .platform_data = &imx_spi1_master_info,
+ },
+};
+
@@ -397,17 +425,18 @@
+};
+
+static struct platform_device imx_spi2 = {
-+ .name = "spi_imx",
-+ .id = 2,
-+ .resource = imx_spi2_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi2_resource),
++ .name = "spi_imx",
++ .id = 2,
++ .resource = imx_spi2_resource,
++ .num_resources = ARRAY_SIZE(imx_spi2_resource),
+ .dev = {
-+ .platform_data = &imx_spi2_master_info,
++ .platform_data = &imx_spi2_master_info,
+ },
+};
+
-+#endif //CONFIG_SPI_IMX
++#endif /* CONFIG_SPI_IMX */
+
++
+#ifdef CONFIG_ARMADEUS_MAX1027
+#define IMX_SPI1_SS_PIN 15
+#define IMX_SPI1_SS (1<<15)
@@ -416,35 +445,35 @@
+
+static int max1027_init(struct spi_device *spi)
+{
-+ imx_gpio_mode( PC14_PF_SPI1_SCLK );
-+ imx_gpio_mode( PC16_PF_SPI1_MISO );
-+ imx_gpio_mode( PC17_PF_SPI1_MOSI );
++ imx_gpio_mode( PC14_PF_SPI1_SCLK );
++ imx_gpio_mode( PC16_PF_SPI1_MISO );
++ imx_gpio_mode( PC17_PF_SPI1_MOSI );
+
-+ /* configure CNVST */
-+ DR(0) |= 1 << MAX1027_CNVST; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* configure CNVST */
++ DR(0) |= 1 << MAX1027_CNVST; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ /* configure EOC */
-+ imx_gpio_mode( GPIO_PORTA | MAX1027_EOC_INT | GPIO_IN | GPIO_GIUS );
++ /* configure EOC */
++ imx_gpio_mode( GPIO_PORTA | MAX1027_EOC_INT | GPIO_IN | GPIO_GIUS );
+
-+ /* SPI CSn is used as chip select but in GPIO mode */
-+ DR(2) |= IMX_SPI1_SS;
-+ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* SPI CSn is used as chip select but in GPIO mode */
++ DR(2) |= IMX_SPI1_SS;
++ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ return 0;
++ return 0;
+}
+
+static int max1027_exit(struct spi_device *spi)
+{
-+ return 0;
++ return 0;
+}
+
+static void max1027_cs(u32 command)
+{
-+ if( command == SPI_CS_DEASSERT )
-+ DR(2) |= IMX_SPI1_SS;
-+ else
-+ DR(2) &= ~IMX_SPI1_SS;
++ if (command == SPI_CS_DEASSERT)
++ DR(2) |= IMX_SPI1_SS;
++ else
++ DR(2) &= ~IMX_SPI1_SS;
+}
+
+static struct spi_imx_chip max1027_hw = {
@@ -455,55 +484,54 @@
+ .conv = MAX1027_CONV_DEFAULT,
+ .setup = MAX1027_SETUP_DEFAULT,
+ .avg = MAX1027_AVG_DEFAULT,
-+ .cnvst_pin = (int)(MAX1027_CNVST|GPIO_PORTA),
++ .cnvst_pin = (int)(MAX1027_CNVST|GPIO_PORTA),
+ .init = max1027_init,
+ .exit = max1027_exit
+};
+
++#endif /* CONFIG_ARMADEUS_MAX1027 */
+
+
-+#endif // CONFIG_ARMADEUS_MAX1027
-+
+#ifdef CONFIG_SPI_TSC2102
+#define TSC2102_CS_GPIOB 17
+#define TSC2102_INT_GPIOD 8
+
+static int tsc2102_init_gpio(void)
+{
-+ // Activate SPI2 port ----
-+ // PortB 17 is used as chip select (in GPIO mode)
-+ DR(1) |= 1 << TSC2102_CS_GPIOB; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTB | TSC2102_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
-+ // Configure SPI2 outputs
-+ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
-+ imx_gpio_mode( PD10_AIN_SPI2_TXD );
-+ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
-+ FMCR |= SPI2_RXD_SEL; // RX is AOUT on PORTD
++ /* Activate SPI2 port ---- */
++ /* PortB 17 is used as chip select (in GPIO mode) */
++ DR(1) |= 1 << TSC2102_CS_GPIOB; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTB | TSC2102_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* Configure SPI2 outputs */
++ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
++ imx_gpio_mode( PD10_AIN_SPI2_TXD );
++ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
++ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
+
-+ // PortD 8 is used as PINTDAV interrupt
-+ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
-+ //imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );
++ /* PortD 8 is used as PINTDAV interrupt */
++ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
++ /*imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );*/
+
-+ printk("TSC2102 GPIOs initialized\n");
-+ return 0;
++ printk("TSC2102 GPIOs initialized\n");
++ return 0;
+}
+
-+// Chip select command for TSC2102
++/* Chip select command for TSC2102 */
+static void tsc2102_cs(u32 command)
+{
-+ // PortB 19 is used as chip select
-+ if( command == SPI_CS_DEASSERT )
-+ DR(1) |= 1<< TSC2102_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< TSC2102_CS_GPIOB);
++ /* PortB 19 is used as chip select */
++ if( command == SPI_CS_DEASSERT )
++ DR(1) |= 1<< TSC2102_CS_GPIOB;
++ else
++ DR(1) &= ~(1<< TSC2102_CS_GPIOB);
+}
+
+static struct spi_imx_chip tsc2102_hw = {
-+ .cs_control = tsc2102_cs,
++ .cs_control = tsc2102_cs,
+};
+
+static struct tsc210x_config apf9328_tsc2102_config = {
-+ .use_internal = 1, // -> use internal voltage reference
++ .use_internal = 1, /* -> use internal voltage reference */
+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
+ .init = tsc2102_init_gpio,
+/* .apm_report = palmte_get_power_status,*/
@@ -512,154 +540,157 @@
+#endif*/
+};
+
-+#endif // CONFIG_SPI_TSC2102
++#endif /* CONFIG_SPI_TSC2102 */
+
++
+#ifdef CONFIG_CAN_MCP251X
+#define CAN_MPC251X_CS_GPIOB 19
+#define CAN_MPC251X_INT_GPIOC 13
+
-+// Chip select command for MCP251X
++/* Chip select command for MCP251X */
+static void mcp251X_cs(u32 command)
+{
-+ // PortB 19 is used as chip select
-+ if( command == SPI_CS_DEASSERT )
-+ DR(1) |= 1<< CAN_MPC251X_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< CAN_MPC251X_CS_GPIOB);
++ /* PortB 19 is used as chip select */
++ if (command == SPI_CS_DEASSERT)
++ DR(1) |= 1<< CAN_MPC251X_CS_GPIOB;
++ else
++ DR(1) &= ~(1<< CAN_MPC251X_CS_GPIOB);
+}
+
+static struct spi_imx_chip mcp251X_hw = {
-+ .cs_control = mcp251X_cs,
++ .cs_control = mcp251X_cs,
+};
+
+static void mcp251X_init_gpio(void)
+{
-+ // Activate SPI2 port ----
-+ // PortB 19 is used as chip select (in GPIO mode)
-+ DR(1) |= 1 << CAN_MPC251X_CS_GPIOB; // Initializes it High
-+ imx_gpio_mode( GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* Activate SPI2 port ---- */
++ /* PortB 19 is used as chip select (in GPIO mode) */
++ DR(1) |= 1 << CAN_MPC251X_CS_GPIOB; /* Initializes it High */
++ imx_gpio_mode( GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR );
+
-+ // PortC 13 is used as CAN interrupt
-+ imx_gpio_mode( GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS );
++ /* PortC 13 is used as CAN interrupt */
++ imx_gpio_mode( GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS );
+
-+ // Configure SPI2 outputs
-+ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
-+ imx_gpio_mode( PD10_AIN_SPI2_TXD );
-+ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
-+ FMCR |= SPI2_RXD_SEL; // RX is AOUT on PORTD
++ /* Configure SPI2 outputs */
++ imx_gpio_mode( PD7_AIN_SPI2_SCLK );
++ imx_gpio_mode( PD10_AIN_SPI2_TXD );
++ imx_gpio_mode( PD9_AOUT_SPI2_RXD );
++ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
+}
+
+static struct mcp251x_platform_data apf9328_mcp251x_config = {
-+ .oscillator_frequency = 16000000,
-+ .board_specific_setup = NULL,
-+ .device_reset = NULL,
-+ .transceiver_enable = NULL,
++ .oscillator_frequency = 16000000,
++ .board_specific_setup = NULL,
++ .device_reset = NULL,
++ .transceiver_enable = NULL,
+};
+
-+#endif // CONFIG_CAN_MCP251X
++#endif /* CONFIG_CAN_MCP251X */
+
+
+static struct spi_board_info spi_board_info[] __initdata = {
+#ifdef CONFIG_ARMADEUS_MAX1027
+{
-+ .modalias = "max1027",
-+ .controller_data = &max1027_hw,
-+ .max_speed_hz = 8000000,
-+ .bus_num = 1, // SPI1
-+ .chip_select = 0,
-+ .mode = 0,
-+ .irq = IRQ_GPIOA(MAX1027_EOC_INT),
-+ .platform_data = &apf9328_max1027_config,
++ .modalias = "max1027",
++ .controller_data= &max1027_hw,
++ .max_speed_hz = 8000000,
++ .bus_num = 1, /* SPI1 */
++ .chip_select = 0,
++ .mode = 0,
++ .irq = IRQ_GPIOA(MAX1027_EOC_INT),
++ .platform_data = &apf9328_max1027_config,
+},
-+#endif // CONFIG_SENSORS_MAX1027
++#endif
+#ifdef CONFIG_SPI_TSC2102
+{
-+ .modalias = "tsc210x",
-+ .controller_data = &tsc2102_hw,
-+ .max_speed_hz = 8000000,
-+ .bus_num = 2, // SPI2
-+ .irq = IRQ_GPIOD(TSC2102_INT_GPIOD),
-+ .chip_select = 0,
-+ .mode = 0,
-+ .platform_data = &apf9328_tsc2102_config,
++ .modalias = "tsc210x",
++ .controller_data= &tsc2102_hw,
++ .max_speed_hz = 8000000,
++ .bus_num = 2, /* SPI2 */
++ .irq = IRQ_GPIOD(TSC2102_INT_GPIOD),
++ .chip_select = 0,
++ .mode = 0,
++ .platform_data = &apf9328_tsc2102_config,
+},
-+#endif // CONFIG_SPI_TSC2102
++#endif
+#ifdef CONFIG_CAN_MCP251X
-+ {
-+ .modalias = "mcp251x",
-+ .max_speed_hz = 8000000, /* 8MHz */
-+ .controller_data = &mcp251X_hw,
-+ .bus_num = 2,
-+ .mode = SPI_MODE_0,
-+ .chip_select = 1,
-+ .irq = IRQ_GPIOC( CAN_MPC251X_INT_GPIOC ),
-+ .platform_data = &apf9328_mcp251x_config,
-+ },
-+#endif // CONFIG_CAN_MCP251X
++{
++ .modalias = "mcp251x",
++ .max_speed_hz = 8000000, /* 8MHz */
++ .controller_data= &mcp251X_hw,
++ .bus_num = 2,
++ .mode = SPI_MODE_0,
++ .chip_select = 1,
++ .irq = IRQ_GPIOC( CAN_MPC251X_INT_GPIOC ),
++ .platform_data = &apf9328_mcp251x_config,
++},
++#endif
+};
+
-+// --- LCD RESSOURCE ---
++/* --- LCD RESSOURCE --- */
+#ifdef CONFIG_FB_IMX
-+// all custom LCD configuration is deported to this file for clarity purpose:
++/* all custom LCD configuration is deported to this file for clarity purpose: */
+#include "apf9328_lcd_config.h"
+#define IMX_FB_PHYS (0x0C000000 - 0x40000)
-+#endif // CONFIG_FB_IMX
++#endif
+
+#ifdef CONFIG_IMX_BACKLIGHT
+static struct imxbl_machinfo imx_bl_machinfo = {
-+ .max_intensity = 0xff,
-+ .default_intensity = 0x90,
-+ .limit_mask = 0x7f, // When battery is low
-+// set_bl_intensity = put a function here if you want to overload default one,
++ .max_intensity = 0xff,
++ .default_intensity = 0x90,
++ .limit_mask = 0x7f, /* When battery is low */
++/* set_bl_intensity = put a function here if you want to overload default one, */
+};
-+//extern struct platform_device imxfb_device; // filled in generic.c
++
+static struct platform_device imxbl_device = {
-+ .name = "imx-bl",
-+ .dev = {
-+// .parent = &imxfb_device.dev, crash kernel even if EXPORT_SYMBOL() is done in generic.c
-+ .platform_data = &imx_bl_machinfo,
-+ },
-+ .id = 0,
++ .name = "imx-bl",
++ .dev = {
++ // .parent = &imxfb_device.dev, crash kernel even if EXPORT_SYMBOL() is done in generic.c
++ .platform_data = &imx_bl_machinfo,
++ },
++ .id = 0,
+};
-+#endif // CONFIG_IMX_BACKLIGHT
++#endif /* CONFIG_IMX_BACKLIGHT */
+
+/*
+ * The APF9328 can have up to 32MB NOR
+ */
+static struct resource flash_resource = {
-+ .start = IMX_CS0_PHYS,
-+ .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1,
-+ .flags = IORESOURCE_MEM,
++ .start = IMX_CS0_PHYS,
++ .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1,
++ .flags = IORESOURCE_MEM,
+};
+
+static struct physmap_flash_data apf9328_flash_data = {
-+ .width = 2,
++ .width = 2,
+};
+
+static struct platform_device apf9328_flash_device = {
-+ .name = "physmap-flash",
-+ .id = 0,
-+ .dev = {
-+ .platform_data = &apf9328_flash_data,
-+ },
-+ .resource = &flash_resource,
-+ .num_resources = 1,
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &apf9328_flash_data,
++ },
++ .resource = &flash_resource,
++ .num_resources = 1,
+};
+
+
+static struct platform_device *devices[] __initdata = {
-+ &imx_uart1_device,
-+ &imx_uart2_device,
++ &imx_uart1_device,
++ &imx_uart2_device,
+#ifdef CONFIG_DM9000
-+ &dm9000x_device,
++ &dm9000x_device,
+#endif
+#ifdef CONFIG_SPI_IMX
-+ &imx_spi1,
-+ &imx_spi2,
++ &imx_spi1,
++ &imx_spi2,
+#endif
-+ &imx_pwm_device,
++#ifdef CONFIG_PWM
++ &imx_pwm_device,
++#endif
+#ifdef CONFIG_IMX_BACKLIGHT
-+ &imxbl_device,
++ &imxbl_device,
+#endif
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+ &tsc2102_alsa_device,
@@ -675,7 +706,7 @@
+{
+ printk("--- Registering APF9328 ressources\n");
+
-+ // Serial
++ /* Serial */
+ imx_gpio_mode(PC9_PF_UART1_CTS);
+ imx_gpio_mode(PC10_PF_UART1_RTS);
+ imx_gpio_mode(PC11_PF_UART1_TXD);
@@ -687,23 +718,23 @@
+ imx_gpio_mode( PB29_PF_UART2_RTS );
+
+#ifdef CONFIG_FB_IMX /* LCD */
-+ set_imx_fb_info(&apf9328_fb_info);
-+ imx_fb_set_gpios(&apf9328_fb_info); /* init PORTD ....*/
++ set_imx_fb_info(&apf9328_fb_info);
++ imx_fb_set_gpios(&apf9328_fb_info); /* init PORTD ....*/
+#endif
+#ifdef CONFIG_CAN_MCP251X
-+ mcp251X_init_gpio();
++ mcp251X_init_gpio();
+#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
+ imx_gpio_mode( ISP1761_GPIO_IRQ | GPIO_IN | GPIO_GIUS ); /* Set up IRQ line. */
-+#endif // CONFIG_ARMADEUS_ISP1761
++#endif
+
-+ platform_add_devices(devices, ARRAY_SIZE(devices));
++ platform_add_devices(devices, ARRAY_SIZE(devices));
+
+#if defined (CONFIG_ARMADEUS_MAX1027) || defined (CONFIG_SPI_TSC2102) || defined (CONFIG_CAN_MCP251X)
-+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
++ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+#endif
+
-+ printk("--- APF9328 ressources registered\n");
++ printk("--- APF9328 ressources registered\n");
+}
+
+/*
@@ -712,62 +743,61 @@
+ */
+static struct map_desc apf9328_io_desc[] __initdata = {
+#ifdef CONFIG_FB_IMX
-+ {
-+ .virtual = IMX_FB_VIRT,
-+ .pfn = __phys_to_pfn(IMX_FB_PHYS),
-+ .length = IMX_FB_SIZE,
-+ .type = MT_DEVICE
-+ },
-+#endif // CONFIG_FB_IMX
-+ // FPGA Memory mapping
-+ {.virtual = IMX_CS1_VIRT, .pfn = __phys_to_pfn(IMX_CS1_PHYS), .length = IMX_CS1_SIZE, .type = MT_DEVICE},
++ {
++ .virtual = IMX_FB_VIRT,
++ .pfn = __phys_to_pfn(IMX_FB_PHYS),
++ .length = IMX_FB_SIZE,
++ .type = MT_DEVICE
++ },
++#endif
++ /* FPGA Memory mapping */
++ {.virtual = IMX_CS1_VIRT, .pfn = __phys_to_pfn(IMX_CS1_PHYS), .length = IMX_CS1_SIZE, .type = MT_DEVICE},
+};
+
+void __init apf9328_map_io(void)
+{
-+ imx_map_io();
-+ iotable_init(apf9328_io_desc, ARRAY_SIZE(apf9328_io_desc));
++ imx_map_io();
++ iotable_init(apf9328_io_desc, ARRAY_SIZE(apf9328_io_desc));
+}
+
+static void __init apf9328_init_irq(void)
+{
-+ // Init generic IRQs
-+ imx_init_irq();
++ /* Init generic IRQs */
++ imx_init_irq();
+
-+ // Init our custom IRQs
++ /* Init our custom IRQs */
+#ifdef CONFIG_DM9000
-+ set_irq_type(APF9328_ETH_IRQ, IRQF_TRIGGER_FALLING);
++ set_irq_type(APF9328_ETH_IRQ, IRQF_TRIGGER_FALLING);
+#endif
+#ifdef CONFIG_SPI_TSC2102
-+ set_irq_type( IRQ_GPIOD(TSC2102_INT_GPIOD), IRQF_TRIGGER_FALLING );
++ set_irq_type( IRQ_GPIOD(TSC2102_INT_GPIOD), IRQF_TRIGGER_FALLING );
+#endif
+#ifdef CONFIG_CAN_MCP251X
-+ set_irq_type( IRQ_GPIOC(CAN_MPC251X_INT_GPIOC), IRQF_TRIGGER_FALLING );
++ set_irq_type( IRQ_GPIOC(CAN_MPC251X_INT_GPIOC), IRQF_TRIGGER_FALLING );
+#endif
+#ifdef CONFIG_ARMADEUS_FPGA_DRIVERS
-+ set_irq_type( APF9328_FPGA_IRQ, IRQF_TRIGGER_RISING );
++ set_irq_type( APF9328_FPGA_IRQ, IRQF_TRIGGER_RISING );
+#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
-+ set_irq_type( ISP1761_IRQ, IRQF_TRIGGER_FALLING );
-+#endif // CONFIG_ARMADEUS_ISP1761
++ set_irq_type( ISP1761_IRQ, IRQF_TRIGGER_FALLING );
++#endif
+}
+
+
+MACHINE_START(APF9328, "Armadeus APF9328")
-+ /* Maintainer: Julien Boibessot, Armadeus */
-+ .phys_io = 0x00200000,
-+ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
-+ .boot_params = 0x08000100,
-+ .map_io = apf9328_map_io,
-+ .init_irq = apf9328_init_irq,
-+ .timer = &imx_timer,
-+ .init_machine = apf9328_init,
++ /* Maintainer: Julien Boibessot, Armadeus */
++ .phys_io = 0x00200000,
++ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
++ .boot_params = 0x08000100,
++ .map_io = apf9328_map_io,
++ .init_irq = apf9328_init_irq,
++ .timer = &imx_timer,
++ .init_machine = apf9328_init,
+MACHINE_END
-+
Index: linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h 2009-04-30 14:37:35.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h 2009-05-01 10:16:10.000000000 +0200
@@ -0,0 +1,263 @@
+/*
+ *
@@ -1035,7 +1065,7 @@
Index: linux-2.6.29/arch/arm/mach-imx/include/mach/apf9328.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29/arch/arm/mach-imx/include/mach/apf9328.h 2009-04-29 15:15:18.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/apf9328.h 2009-05-01 10:16:10.000000000 +0200
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1248
http://armadeus.svn.sourceforge.net/armadeus/?rev=1248&view=rev
Author: artemys
Date: 2009-04-30 21:34:55 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Makes imxmmc driver compiles again on 2.6.29
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch 2009-04-30 16:09:17 UTC (rev 1247)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch 2009-04-30 21:34:55 UTC (rev 1248)
@@ -6,24 +6,31 @@
inserted. So chip's internal pull-down resistor is activated to have
this pin low by default (recommended by MMC specs in any case).
+Note: requires to replace IO_ADDRESS(IMX_MMC_BASE) with host->base
+ to be clean. (But how ?)
+
Signed-off-by: Julien Boibessot <jul...@ar...>
Signed-off-by: Eric Jarrige <jo...@ar...>
---- linux-org/drivers/mmc/host/imxmmc.c
-+++ linux-imx/drivers/mmc/host/imxmmc.c
-@@ -901,6 +901,27 @@
+Index: linux-2.6.29/drivers/mmc/host/imxmmc.c
+===================================================================
+--- linux-2.6.29.orig/drivers/mmc/host/imxmmc.c 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29/drivers/mmc/host/imxmmc.c 2009-04-30 23:12:36.000000000 +0200
+@@ -911,6 +911,29 @@
.get_ro = imxmci_get_ro,
};
+/* Controller built-in card detection */
-+static int imxmci_card_present(void)
++static int imxmci_card_present(struct device *dev)
+{
+ static int current_state = 1;
+ static int nb_trials = 3;
-+ int new_state = (MMC_STATUS & STATUS_CARD_PRESENCE) ? 1 : 0;
++ /* struct imxmci_host *host = how to get it from dev ?? */
++ u16 status = readw(IO_ADDRESS(IMX_MMC_BASE) + MMC_REG_STATUS);
++ int new_state = (status & STATUS_CARD_PRESENCE) ? 1 : 0;
+
+ /* Take state into account only if data are not being transmitted */
-+ if (!(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
++ if (!(status & STATUS_CARD_BUS_CLK_RUN)
+ && (new_state != current_state)) {
+ if (0 == --nb_trials) {
+ current_state = new_state;
@@ -39,19 +46,21 @@
static void imxmci_check_status(unsigned long data)
{
struct imxmci_host *host = (struct imxmci_host *)data;
-@@ -1022,6 +1041,10 @@
- ret = request_irq(host->irq, imxmci_irq, 0, DRIVER_NAME, host);
+@@ -1043,6 +1066,10 @@
if (ret)
goto out;
-+
+
+ /* If no way of detecting card is given, use built-in method */
+ if (!host->pdata->card_present)
+ host->pdata->card_present = imxmci_card_present;
-
++
if (host->pdata && host->pdata->card_present)
host->present = host->pdata->card_present(mmc_dev(mmc));
---- linux-org/arch/arm/mach-imx/include/mach/imx-regs.h
-+++ linux-imx/arch/arm/mach-imx/include/mach/imx-regs.h
+ else /* if there is no way to detect assume that card is present */
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h
+===================================================================
+--- linux-2.6.29.orig/arch/arm/mach-imx/include/mach/imx-regs.h 2009-04-30 23:09:11.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h 2009-04-30 23:11:18.000000000 +0200
@@ -172,7 +172,7 @@
#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 16:09:18
|
Revision: 1247
http://armadeus.svn.sourceforge.net/armadeus/?rev=1247&view=rev
Author: artemys
Date: 2009-04-30 16:09:17 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Makes apf9328 fpgaloader compiles on 2.6.29
Modified Paths:
--------------
trunk/target/linux/modules/fpga/dev_tools/loader/apf9328-fpga-loader.c
Modified: trunk/target/linux/modules/fpga/dev_tools/loader/apf9328-fpga-loader.c
===================================================================
--- trunk/target/linux/modules/fpga/dev_tools/loader/apf9328-fpga-loader.c 2009-04-30 15:50:12 UTC (rev 1246)
+++ trunk/target/linux/modules/fpga/dev_tools/loader/apf9328-fpga-loader.c 2009-04-30 16:09:17 UTC (rev 1247)
@@ -22,28 +22,24 @@
#include <asm/io.h>
#include <linux/platform_device.h>
+#include <mach/hardware.h>
+#include <mach/gpio.h>
#include "xilinx-fpga-loader.h"
-
#define FPGA_INIT (GPIO_PORTB | 15) /* FPGA init pin (SSI input) */
#define FPGA_DONE (GPIO_PORTB | 16) /* FPGA done pin (SSI input) */
#define FPGA_DIN (GPIO_PORTB | 17) /* FPGA data pin (SSI output) */
#define FPGA_PROGRAM (GPIO_PORTB | 18) /* FPGA prog pin (SSI output) */
#define FPGA_CLOCK (GPIO_PORTB | 19) /* FPGA clk pin (SSI output) */
-#define GPIO_PORT(x) ((x >> 5) & 3)
-#define GPIO_SET(x) (DR(GPIO_PORT(x)) |= (1<<(x & GPIO_PIN_MASK)))
-#define GPIO_CLEAR(x) (DR(GPIO_PORT(x)) &= ~(1<<(x & GPIO_PIN_MASK)))
-#define GPIO_WRITE(x,y) ( y ? GPIO_SET(x) : GPIO_CLEAR(x) )
-#define GPIO_READ(x) ((SSR (GPIO_PORT(x)) & (1<<(x & GPIO_PIN_MASK))))
/*
* Set the FPGA's active-low program line to the specified level
*/
static int apf9328_fpga_pgm( int assert )
{
- GPIO_WRITE( FPGA_PROGRAM, !assert);
+ gpio_set_value(FPGA_PROGRAM, !assert);
return assert;
}
@@ -52,7 +48,7 @@
*/
static int apf9328_fpga_clk( int assert_clk )
{
- GPIO_WRITE( FPGA_CLOCK, assert_clk);
+ gpio_set_value(FPGA_CLOCK, assert_clk);
return assert_clk;
}
@@ -62,7 +58,7 @@
*/
static int apf9328_fpga_init( void )
{
- return(!GPIO_READ(FPGA_INIT));
+ return(!gpio_get_value(FPGA_INIT));
}
/*
@@ -70,7 +66,7 @@
*/
static int apf9328_fpga_done( void )
{
- return(GPIO_READ(FPGA_DONE));
+ return(gpio_get_value(FPGA_DONE));
}
/*
@@ -78,18 +74,18 @@
*/
static int apf9328_fpga_wr( int assert_write )
{
- GPIO_WRITE( FPGA_DIN, assert_write);
+ gpio_set_value(FPGA_DIN, assert_write);
return assert_write;
}
static int apf9328_fpga_pre( void )
{
/* Initialize GPIO pins */
- imx_gpio_mode (FPGA_INIT | GPIO_GIUS | GPIO_DR | GPIO_IN );
- imx_gpio_mode (FPGA_DONE | GPIO_GIUS | GPIO_DR | GPIO_IN );
- imx_gpio_mode (FPGA_DIN | GPIO_GIUS | GPIO_DR | GPIO_OUT );
- imx_gpio_mode (FPGA_PROGRAM | GPIO_GIUS | GPIO_DR | GPIO_OUT );
- imx_gpio_mode (FPGA_CLOCK | GPIO_GIUS | GPIO_DR | GPIO_OUT );
+ imx_gpio_mode(FPGA_INIT | GPIO_GIUS | GPIO_DR | GPIO_IN);
+ imx_gpio_mode(FPGA_DONE | GPIO_GIUS | GPIO_DR | GPIO_IN);
+ imx_gpio_mode(FPGA_DIN | GPIO_GIUS | GPIO_DR | GPIO_OUT);
+ imx_gpio_mode(FPGA_PROGRAM | GPIO_GIUS | GPIO_DR | GPIO_OUT);
+ imx_gpio_mode(FPGA_CLOCK | GPIO_GIUS | GPIO_DR | GPIO_OUT);
return 1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 15:50:13
|
Revision: 1246
http://armadeus.svn.sourceforge.net/armadeus/?rev=1246&view=rev
Author: artemys
Date: 2009-04-30 15:50:12 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Displays Tuz instead of Tux as boot logo (2.6.29)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config 2009-04-30 14:59:09 UTC (rev 1245)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config 2009-04-30 15:50:12 UTC (rev 1246)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
-# Thu Apr 2 09:35:46 2009
+# Thu Apr 30 17:38:27 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -993,8 +993,8 @@
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
-CONFIG_LOGO_ARMADEUS_CLUT224=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO_ARMADEUS_CLUT224 is not set
CONFIG_SOUND=m
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=m
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config 2009-04-30 14:59:09 UTC (rev 1245)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.29.config 2009-04-30 15:50:12 UTC (rev 1246)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
-# Tue Apr 14 20:57:39 2009
+# Thu Apr 30 17:38:27 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -922,8 +922,8 @@
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
-CONFIG_LOGO_ARMADEUS_CLUT224=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO_ARMADEUS_CLUT224 is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SND=m
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 14:59:15
|
Revision: 1245
http://armadeus.svn.sourceforge.net/armadeus/?rev=1245&view=rev
Author: artemys
Date: 2009-04-30 14:59:09 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Puts MTD physmap declaration in apf9328.c (seems to be the standard now in 2.6.29)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-04-30 14:03:03 UTC (rev 1244)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-04-30 14:59:09 UTC (rev 1245)
@@ -4,8 +4,8 @@
Index: linux-2.6.29/arch/arm/mach-imx/apf9328.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29/arch/arm/mach-imx/apf9328.c 2009-04-29 17:01:46.000000000 +0200
-@@ -0,0 +1,730 @@
++++ linux-2.6.29/arch/arm/mach-imx/apf9328.c 2009-04-30 16:33:54.000000000 +0200
+@@ -0,0 +1,758 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -28,6 +28,8 @@
+ */
+
+#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/mtd/physmap.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/serial_8250.h>
@@ -621,6 +623,30 @@
+};
+#endif // CONFIG_IMX_BACKLIGHT
+
++/*
++ * The APF9328 can have up to 32MB NOR
++ */
++static struct resource flash_resource = {
++ .start = IMX_CS0_PHYS,
++ .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct physmap_flash_data apf9328_flash_data = {
++ .width = 2,
++};
++
++static struct platform_device apf9328_flash_device = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &apf9328_flash_data,
++ },
++ .resource = &flash_resource,
++ .num_resources = 1,
++};
++
++
+static struct platform_device *devices[] __initdata = {
+ &imx_uart1_device,
+ &imx_uart2_device,
@@ -642,13 +668,14 @@
+#ifdef CONFIG_ARMADEUS_ISP1761
+ &devfull_isp1761_device,
+#endif
++ &apf9328_flash_device,
+};
+
+static void __init apf9328_init(void)
+{
-+ printk("--- Registering APF9328 ressources\n");
++ printk("--- Registering APF9328 ressources\n");
+
-+ // Serial
++ // Serial
+ imx_gpio_mode(PC9_PF_UART1_CTS);
+ imx_gpio_mode(PC10_PF_UART1_RTS);
+ imx_gpio_mode(PC11_PF_UART1_TXD);
@@ -736,6 +763,7 @@
+ .timer = &imx_timer,
+ .init_machine = apf9328_init,
+MACHINE_END
++
Index: linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 14:03:04
|
Revision: 1244
http://armadeus.svn.sourceforge.net/armadeus/?rev=1244&view=rev
Author: artemys
Date: 2009-04-30 14:03:03 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[BUILDROOT] Makes 2.6.29 kernel selectable (for the hackers ;-) )
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
Added Paths:
-----------
trunk/patches/074-buildroot-add_2_6_29_kernel_choice.diff
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-04-30 12:58:22 UTC (rev 1243)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-04-30 14:03:03 UTC (rev 1244)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328.c
+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328.c
-@@ -0,0 +1,763 @@
+@@ -0,0 +1,762 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -771,7 +771,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328_lcd_config.h
+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328_lcd_config.h
-@@ -0,0 +1,200 @@
+@@ -0,0 +1,193 @@
+/*
+ *
+ * Armadeus LCD configuration file
@@ -841,7 +841,7 @@
+}
+
+
-+static struct imx_fb_platform_data apf9328_fb_info __initdata = {
++static struct imxfb_mach_info apf9328_fb_info __initdata = {
+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
+ .pixclock = 62500,
+ .bpp = 16,
Added: trunk/patches/074-buildroot-add_2_6_29_kernel_choice.diff
===================================================================
--- trunk/patches/074-buildroot-add_2_6_29_kernel_choice.diff (rev 0)
+++ trunk/patches/074-buildroot-add_2_6_29_kernel_choice.diff 2009-04-30 14:03:03 UTC (rev 1244)
@@ -0,0 +1,38 @@
+--- buildroot/target/linux/Config.in.advanced.org 2009-04-30 15:04:16.000000000 +0200
++++ buildroot/target/linux/Config.in.advanced 2009-04-30 15:11:02.000000000 +0200
+@@ -48,6 +48,7 @@
+
+ config BR2_KERNEL_NEXT_VERSION
+ string
++ default "2.6.29" if BR2_LINUX_2_6_28
+ default "2.6.28" if BR2_LINUX_2_6_27
+ default "2.6.27" if BR2_LINUX_2_6_26
+ default "2.6.26" if BR2_LINUX_2_6_25
+@@ -59,6 +60,7 @@
+
+ config BR2_KERNEL_THIS_VERSION
+ string
++ default "2.6.29" if BR2_LINUX_2_6_29
+ default "2.6.28" if BR2_LINUX_2_6_28
+ default "2.6.27" if BR2_LINUX_2_6_27
+ default "2.6.26" if BR2_LINUX_2_6_26
+@@ -138,11 +140,19 @@
+
+ config BR2_LINUX_2_6_STABLE
+ bool "The latest stable Linux kernel (2.6.26.3)"
++ depends on !BR2_TARGET_ARMADEUS
+ help
+ Linux 2.6.26.3
+
++config BR2_LINUX_2_6_29
++ bool "Linux 2.6.29 (experimental)"
++ select BR2_KERNEL_BASE
++ help
++ Linux 2.6.29
++
+ config BR2_LINUX_2_6_28
+ bool "Linux 2.6.28"
++ depends on !BR2_TARGET_ARMADEUS
+ select BR2_KERNEL_BASE
+ help
+ Linux 2.6.28
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 12:58:28
|
Revision: 1243
http://armadeus.svn.sourceforge.net/armadeus/?rev=1243&view=rev
Author: artemys
Date: 2009-04-30 12:58:22 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Makes ISP1761 driver compiles on 2.6.29
Modified Paths:
--------------
trunk/target/linux/modules/isp1761/hal/isp1761.h
Modified: trunk/target/linux/modules/isp1761/hal/isp1761.h
===================================================================
--- trunk/target/linux/modules/isp1761/hal/isp1761.h 2009-04-30 12:56:20 UTC (rev 1242)
+++ trunk/target/linux/modules/isp1761/hal/isp1761.h 2009-04-30 12:58:22 UTC (rev 1243)
@@ -224,3 +224,10 @@
#undef DEBUG
#endif
/*******************END FOR ALL CONTROLLERS*******************************/
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
+#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " format "\n" , ## arg)
+#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " format "\n" , ## arg)
+#endif
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-30 12:56:35
|
Revision: 1242
http://armadeus.svn.sourceforge.net/armadeus/?rev=1242&view=rev
Author: artemys
Date: 2009-04-30 12:56:20 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Cleanup lcd_config file + initializes GPIOs for 2.6.29. Now waiting Nico's black Magic...
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/013-armadeus-imxfb-improvements.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-04-29 07:56:32 UTC (rev 1241)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/021-armadeus-apf9328.patch 2009-04-30 12:56:20 UTC (rev 1242)
@@ -219,7 +219,7 @@
+
+
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
-+int apf9328_ssi_gpio_init(struct platform_device *pdev)
++int apf9328_ssi_gpio_init(struct platform_device *pdev)
+{
+ /* Activate SSI on PortC */
+ imx_gpio_mode(PC3_PF_SSI_RXFS);
@@ -233,7 +233,7 @@
+ FMCR &= ~(SSI_TXFS_SEL);
+ imx_gpio_mode(PC8_PF_SSI_TXCLK);
+ FMCR &= ~(SSI_TXCLK_SEL);
-+
++
+ printk("SSI pins configured\n");
+ return 0;
+}
@@ -435,18 +435,17 @@
+#endif //CONFIG_SPI_IMX
+
+#ifdef CONFIG_ARMADEUS_MAX1027
-+#define IMX_SPI1_SS_PIN 15
++#define IMX_SPI1_SS_PIN 15
+#define IMX_SPI1_SS (1<<15)
+#define MAX1027_EOC_INT 13
+#define MAX1027_CNVST 14
+
+static int max1027_init(struct spi_device *spi)
-+{
++{
+ imx_gpio_mode( PC14_PF_SPI1_SCLK );
+ imx_gpio_mode( PC16_PF_SPI1_MISO );
+ imx_gpio_mode( PC17_PF_SPI1_MOSI );
+
-+
+ /* configure CNVST */
+ DR(0) |= 1 << MAX1027_CNVST; // Initializes it High
+ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
@@ -457,13 +456,13 @@
+ /* SPI CSn is used as chip select but in GPIO mode */
+ DR(2) |= IMX_SPI1_SS;
+ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
-+
++
+ return 0;
+}
+
+static int max1027_exit(struct spi_device *spi)
+{
-+ return 0;
++ return 0;
+}
+
+static void max1027_cs(u32 command)
@@ -493,7 +492,7 @@
+
+#ifdef CONFIG_SPI_TSC2102
+#define TSC2102_CS_GPIOB 17
-+#define TSC2102_INT_GPIOD 8
++#define TSC2102_INT_GPIOD 8
+
+static int tsc2102_init_gpio(void)
+{
@@ -543,7 +542,7 @@
+
+#ifdef CONFIG_CAN_MCP251X
+#define CAN_MPC251X_CS_GPIOB 19
-+#define CAN_MPC251X_INT_GPIOC 13
++#define CAN_MPC251X_INT_GPIOC 13
+
+// Chip select command for MCP251X
+static void mcp251X_cs(u32 command)
@@ -679,16 +678,16 @@
+{
+ printk("--- Registering APF9328 ressources\n");
+
-+ // Serial
++ // Serial
+ imx_gpio_mode(PC9_PF_UART1_CTS);
+ imx_gpio_mode(PC10_PF_UART1_RTS);
+ imx_gpio_mode(PC11_PF_UART1_TXD);
+ imx_gpio_mode(PC12_PF_UART1_RXD);
+
-+ imx_gpio_mode( PB30_PF_UART2_TXD );
-+ imx_gpio_mode( PB31_PF_UART2_RXD );
-+ imx_gpio_mode( PB28_PF_UART2_CTS );
-+ imx_gpio_mode( PB29_PF_UART2_RTS );
++ imx_gpio_mode( PB30_PF_UART2_TXD );
++ imx_gpio_mode( PB31_PF_UART2_RXD );
++ imx_gpio_mode( PB28_PF_UART2_CTS );
++ imx_gpio_mode( PB29_PF_UART2_RTS );
+
+#ifdef CONFIG_FB_IMX /* LCD */
+ set_imx_fb_info(&apf9328_fb_info);
@@ -705,7 +704,7 @@
+
+#if defined (CONFIG_ARMADEUS_MAX1027) || defined (CONFIG_SPI_TSC2102) || defined (CONFIG_CAN_MCP251X)
+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
-+#endif
++#endif
+
+ printk("--- APF9328 ressources registered\n");
+}
@@ -842,8 +841,8 @@
+}
+
+
++static struct imx_fb_platform_data apf9328_fb_info __initdata = {
+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 480,
@@ -856,15 +855,13 @@
+ .right_margin = 0,
+ .lower_margin = 3,
+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
+ PCR_CLKPOL | PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(5),
-+ .pwmr = 0x000003ff, // Contrast with PWM @ Pixel clock / 256, max width by default
++ .pwmr = 0x000003ff, /* Contrast with PWM @ Pixel clock / 256, max width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power = apf9328_lcd_backlight_power,
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_MICROTIPS_MTF_T035_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 320,
@@ -882,9 +879,7 @@
+ .pwmr = 0x00000150, /* Contrast with PWM @ Line Pulse / 256, medium width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power = apf9328_lcd_backlight_power,
-+};
+#elif CONFIG_FB_IMX_SHARP_LQ057_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 320,
@@ -899,31 +894,28 @@
+
+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | /*PCR_CLKPOL |*/
+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
-+ .pwmr = 0, // No contrast management
++ .pwmr = 0, /* No contrast management */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_OPTREX_F51900_CSTN
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 8,
+ .xres = 320,
+ .yres = 240,
-+
++
+ .hsync_len = 2,
+ .vsync_len = 2,
+ .left_margin = 2,
+ .upper_margin = 2,
+ .right_margin = 2,
+ .lower_margin = 2,
-+
-+ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
++
++ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
+ PCR_END_BYTE_SWAP | PCR_PCD(3),
+ .dmacr = DEFAULT_DMA_SETTINGS,
++ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_MOTOROLA_A910_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 240,
@@ -936,15 +928,15 @@
+ .right_margin = 27,
+ .lower_margin = 4,
+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
+ .dmacr = DEFAULT_DMA_SETTINGS,
-+ .pwmr = 0, // No contrast management
++ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf9328_lcd_power,
-+};
+#else
+#error Please define a imxfb_mach_info structure with your LCD parameters here
-+#endif
++#endif
++};
+
+/*
+ * Configure custom GPIOs needed by LCDs
@@ -1039,6 +1031,6 @@
+// USB HOST ISP1760: option available with APF_devfull
+#define ISP1761_BASE IMX_CS3_PHYS
+#define ISP1761_GPIO_IRQ ( GPIO_PORTC | 10 )
-+#define ISP1761_IRQ ( IRQ_GPIOC(10) )
++#define ISP1761_IRQ ( IRQ_GPIOC(10) )
+
+#endif // __ASM_ARCH_APF9328_H
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/013-armadeus-imxfb-improvements.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/013-armadeus-imxfb-improvements.patch 2009-04-29 07:56:32 UTC (rev 1241)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/013-armadeus-imxfb-improvements.patch 2009-04-30 12:56:20 UTC (rev 1242)
@@ -4,7 +4,7 @@
Index: linux-2.6.29/drivers/video/imxfb.c
===================================================================
--- linux-2.6.29.orig/drivers/video/imxfb.c 2009-03-24 00:12:14.000000000 +0100
-+++ linux-2.6.29/drivers/video/imxfb.c 2009-03-30 10:47:00.000000000 +0200
++++ linux-2.6.29/drivers/video/imxfb.c 2009-04-29 15:15:10.000000000 +0200
@@ -437,6 +437,7 @@
pr_debug("var: yres=%d vslen=%d um=%d bm=%d\n",
var->yres, var->vsync_len,
@@ -17,11 +17,11 @@
goto failed_cmap;
imxfb_set_par(info);
-+ /* JB: The following parameters are only needed once at startup and so
++ /* JB: The following parameters are only needed once at startup and so
+ removed from from imxfb_set_par()/imxfb_activate_var() */
-+ LCDC_PWMR = fbi->pwmr;
-+ LCDC_LSCR1 = fbi->lscr1;
-+ LCDC_DMACR = fbi->dmacr;
++ writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
++ writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
++ writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
+
ret = register_framebuffer(info);
if (ret < 0) {
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-04-29 07:56:32 UTC (rev 1241)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch 2009-04-30 12:56:20 UTC (rev 1242)
@@ -1,9 +1,11 @@
PATCH AUTOMATICALLY GENERATED
DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328.c
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328.c
-@@ -0,0 +1,731 @@
+Index: linux-2.6.29/arch/arm/mach-imx/apf9328.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29/arch/arm/mach-imx/apf9328.c 2009-04-29 17:01:46.000000000 +0200
+@@ -0,0 +1,730 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -189,7 +191,7 @@
+};
+
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
-+int apf9328_ssi_gpio_init(struct platform_device *pdev)
++int apf9328_ssi_gpio_init(struct platform_device *pdev)
+{
+ /* Activate SSI on PortC */
+ imx_gpio_mode(PC3_PF_SSI_RXFS);
@@ -203,7 +205,7 @@
+ FMCR &= ~(SSI_TXFS_SEL);
+ imx_gpio_mode(PC8_PF_SSI_TXCLK);
+ FMCR &= ~(SSI_TXCLK_SEL);
-+
++
+ printk("SSI pins configured\n");
+ return 0;
+}
@@ -405,18 +407,17 @@
+#endif //CONFIG_SPI_IMX
+
+#ifdef CONFIG_ARMADEUS_MAX1027
-+#define IMX_SPI1_SS_PIN 15
++#define IMX_SPI1_SS_PIN 15
+#define IMX_SPI1_SS (1<<15)
+#define MAX1027_EOC_INT 13
+#define MAX1027_CNVST 14
+
+static int max1027_init(struct spi_device *spi)
-+{
++{
+ imx_gpio_mode( PC14_PF_SPI1_SCLK );
+ imx_gpio_mode( PC16_PF_SPI1_MISO );
+ imx_gpio_mode( PC17_PF_SPI1_MOSI );
+
-+
+ /* configure CNVST */
+ DR(0) |= 1 << MAX1027_CNVST; // Initializes it High
+ imx_gpio_mode( GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR );
@@ -427,13 +428,13 @@
+ /* SPI CSn is used as chip select but in GPIO mode */
+ DR(2) |= IMX_SPI1_SS;
+ imx_gpio_mode( GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
-+
++
+ return 0;
+}
+
+static int max1027_exit(struct spi_device *spi)
+{
-+ return 0;
++ return 0;
+}
+
+static void max1027_cs(u32 command)
@@ -463,7 +464,7 @@
+
+#ifdef CONFIG_SPI_TSC2102
+#define TSC2102_CS_GPIOB 17
-+#define TSC2102_INT_GPIOD 8
++#define TSC2102_INT_GPIOD 8
+
+static int tsc2102_init_gpio(void)
+{
@@ -513,7 +514,7 @@
+
+#ifdef CONFIG_CAN_MCP251X
+#define CAN_MPC251X_CS_GPIOB 19
-+#define CAN_MPC251X_INT_GPIOC 13
++#define CAN_MPC251X_INT_GPIOC 13
+
+// Chip select command for MCP251X
+static void mcp251X_cs(u32 command)
@@ -647,20 +648,20 @@
+{
+ printk("--- Registering APF9328 ressources\n");
+
-+ // Serial
++ // Serial
+ imx_gpio_mode(PC9_PF_UART1_CTS);
+ imx_gpio_mode(PC10_PF_UART1_RTS);
+ imx_gpio_mode(PC11_PF_UART1_TXD);
+ imx_gpio_mode(PC12_PF_UART1_RXD);
+
-+ imx_gpio_mode( PB30_PF_UART2_TXD );
-+ imx_gpio_mode( PB31_PF_UART2_RXD );
-+ imx_gpio_mode( PB28_PF_UART2_CTS );
-+ imx_gpio_mode( PB29_PF_UART2_RTS );
++ imx_gpio_mode( PB30_PF_UART2_TXD );
++ imx_gpio_mode( PB31_PF_UART2_RXD );
++ imx_gpio_mode( PB28_PF_UART2_CTS );
++ imx_gpio_mode( PB29_PF_UART2_RTS );
+
+#ifdef CONFIG_FB_IMX /* LCD */
+ set_imx_fb_info(&apf9328_fb_info);
-+ imx_fb_set_gpios(); /* init PORTD ....*/
++ imx_fb_set_gpios(&apf9328_fb_info); /* init PORTD ....*/
+#endif
+#ifdef CONFIG_CAN_MCP251X
+ mcp251X_init_gpio();
@@ -673,7 +674,7 @@
+
+#if defined (CONFIG_ARMADEUS_MAX1027) || defined (CONFIG_SPI_TSC2102) || defined (CONFIG_CAN_MCP251X)
+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
-+#endif
++#endif
+
+ printk("--- APF9328 ressources registered\n");
+}
@@ -735,12 +736,11 @@
+ .timer = &imx_timer,
+ .init_machine = apf9328_init,
+MACHINE_END
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/apf9328_lcd_config.h
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/apf9328_lcd_config.h
-@@ -0,0 +1,200 @@
+Index: linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29/arch/arm/mach-imx/apf9328_lcd_config.h 2009-04-30 14:37:35.000000000 +0200
+@@ -0,0 +1,263 @@
+/*
+ *
+ * Armadeus LCD configuration file
@@ -758,12 +758,16 @@
+#ifdef CONFIG_FB_IMX
+#include <mach/imxfb.h>
+#include <linux/delay.h>
++#include <mach/gpio.h>
+
-+#define LCD_PORT 3 /* Port D */
++#ifdef CONFIG_ARCH_IMX
++#define LCDC_BASE_ADDR IMX_LCDC_BASE
++#define LCDISR_EOF (1 << 1)
++#endif
+
-+#define OPTREX_F51900_POWER_DOWN 7 /* PD7_REV line */
-+#define SHARP_LQ043_POWER_DOWN 12 /* PD12_ACD_OE line */
-+#define CONTRAST_LINE 11 /* PD11_CONTRAST */
++#define OPTREX_F51900_POWER_DOWN (GPIO_PORTD | 7) /* PD7_REV */
++#define SHARP_LQ043_POWER_DOWN (GPIO_PORTD | 12) /* PD12_ACD_OE */
++#define CONTRAST_LINE (GPIO_PORTD | 11) /* PD11_CONTRAST */
+
+#define DEFAULT_DMA_SETTINGS (DMACR_BURST | DMACR_HM(8) | DMACR_TM(4))
+
@@ -772,28 +776,41 @@
+ */
+static void apf9328_lcd_power(int on)
+{
-+ pr_debug("apf9328_lcd_power: %s\n", on ? "on":"off");
++ u32 isr;
++
++ pr_debug("apf9328_lcd_power: %s\n", on ? "on":"off");
+#ifdef CONFIG_FB_IMX_OPTREX_F51900_CSTN
-+ if(on)
-+ DR(LCD_PORT) |= (1 << OPTREX_F51900_POWER_DOWN);
-+ else
-+ DR(LCD_PORT) &= ~(1 << OPTREX_F51900_POWER_DOWN);
++ if (on)
++ gpio_set_value(OPTREX_F51900_POWER_DOWN, 1);
++ else
++ gpio_set_value(OPTREX_F51900_POWER_DOWN, 0);
+//#elif CONFIG_FB_IMX_MICROTIPS_MTF_T035_TFT
-+ // No LCD powerdown yet
++ /* No LCD powerdown yet */
+#elif CONFIG_FB_IMX_SHARP_LQ043_TFT
-+ if(on) {
-+ mdelay(200); // at least ten frames have to be processed before
-+ // enabling the display
-+ DR(LCD_PORT) |= (1 << SHARP_LQ043_POWER_DOWN);
-+ }
-+ else
-+ DR(LCD_PORT) &= ~(1 << SHARP_LQ043_POWER_DOWN);
++ if (on) {
++ mdelay(200); /* at least ten frames have to be processed before
++ enabling the display */
++ /* Waits end of current frame */
++ isr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x40);
++ do {
++ isr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x40);
++ udelay(1000);
++ pr_debug("%08x\n", isr);
++ } while ((isr & LCDISR_EOF) == 0);
++
++ gpio_set_value(SHARP_LQ043_POWER_DOWN, 1);
++ } else {
++ gpio_set_value(SHARP_LQ043_POWER_DOWN, 0);
++ mdelay(200); /* needs to wait 10 frames after DISP goes down
++ before shutting down LCDC (done in imxfb) */
++ }
+#else
-+ if(on)
-+ DR(LCD_PORT) &= ~(1 << CONTRAST_LINE);
-+ else
-+ DR(LCD_PORT) |= (1 << CONTRAST_LINE);
-+#endif // CONFIG_FB_IMX_OPTREX_F51900_CSTN
++ if (on) {
++ gpio_set_value(CONTRAST_LINE, 0);
++ } else {
++ gpio_set_value(CONTRAST_LINE, 1);
++ }
++#endif /* CONFIG_FB_IMX_OPTREX_F51900_CSTN */
+}
+
+/*
@@ -801,17 +818,22 @@
+ */
+static void apf9328_lcd_backlight_power(int on)
+{
-+ pr_debug("apf9328_lcd_backlight_power: %s\n", on ? "on":"off");
++ u32 pwmr;
+
-+ if(on)
-+ LCDC_PWMR |= PWMR_CC_EN;
-+ else
-+ LCDC_PWMR &= ~PWMR_CC_EN;
++ pr_debug("apf9328_lcd_backlight_power: %s\n", on ? "on":"off");
++
++ pwmr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x2c);
++ if (on) {
++ pwmr |= PWMR_CC_EN;
++ } else {
++ pwmr &= ~PWMR_CC_EN;
++ }
++ writel(pwmr, IO_ADDRESS(LCDC_BASE_ADDR) + 0x2c);
+}
+
+
++static struct imx_fb_platform_data apf9328_fb_info __initdata = {
+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 480,
@@ -824,15 +846,13 @@
+ .right_margin = 0,
+ .lower_margin = 3,
+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
+ PCR_CLKPOL | PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(5),
-+ .pwmr = 0x000003ff, // Contrast with PWM @ Pixel clock / 256, max width by default
++ .pwmr = 0x000003ff, /* Contrast with PWM @ Pixel clock / 256, max width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power = apf9328_lcd_backlight_power,
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_MICROTIPS_MTF_T035_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 320,
@@ -850,9 +870,7 @@
+ .pwmr = 0x00000150, /* Contrast with PWM @ Line Pulse / 256, medium width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power = apf9328_lcd_backlight_power,
-+};
+#elif CONFIG_FB_IMX_SHARP_LQ057_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 320,
@@ -867,31 +885,28 @@
+
+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | /*PCR_CLKPOL |*/
+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
-+ .pwmr = 0, // No contrast management
++ .pwmr = 0, /* No contrast management */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_OPTREX_F51900_CSTN
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 8,
+ .xres = 320,
+ .yres = 240,
-+
++
+ .hsync_len = 2,
+ .vsync_len = 2,
+ .left_margin = 2,
+ .upper_margin = 2,
+ .right_margin = 2,
+ .lower_margin = 2,
-+
-+ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
++
++ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
+ PCR_END_BYTE_SWAP | PCR_PCD(3),
+ .dmacr = DEFAULT_DMA_SETTINGS,
++ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf9328_lcd_power,
-+};
+#elif CONFIG_FB_IMX_MOTOROLA_A910_TFT
-+static struct imxfb_mach_info apf9328_fb_info __initdata = {
+ .pixclock = 62500,
+ .bpp = 16,
+ .xres = 240,
@@ -904,48 +919,95 @@
+ .right_margin = 27,
+ .lower_margin = 4,
+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
+ .dmacr = DEFAULT_DMA_SETTINGS,
-+ .pwmr = 0, // No contrast management
++ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf9328_lcd_power,
-+};
+#else
+#error Please define a imxfb_mach_info structure with your LCD parameters here
-+#endif
++#endif
++};
+
+/*
-+ * Configure custom GPIOs needed by LCDs
++ * Configure all GPIOs needed by LCDs
+ */
-+static void imx_fb_set_gpios(void)
++static void imx_fb_set_gpios(struct imx_fb_platform_data *fb_inf)
+{
++ int width;
+
++ pr_debug("%s\n", __func__);
++
+#ifdef CONFIG_FB_IMX_OPTREX_F51900_CSTN
-+ DR(LCD_PORT) |= (1 << OPTREX_F51900_POWER_DOWN); // Initializes it High
-+ imx_gpio_mode( GPIO_PORTD | OPTREX_F51900_POWER_DOWN | GPIO_OUT | GPIO_DR );
++ gpio_set_value(OPTREX_F51900_POWER_DOWN, 1); /* Initializes it High */
++ imx_gpio_mode(OPTREX_F51900_POWER_DOWN | GPIO_OUT | GPIO_DR);
++#endif
++#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
++ /* ACD_OE (SHARP_LQ043_POWER_DOWN) used as power down signal */
++ gpio_set_value(SHARP_LQ043_POWER_DOWN, 0); /* Initializes it Low */
++ imx_gpio_mode(SHARP_LQ043_POWER_DOWN | GPIO_OUT | GPIO_GIUS | GPIO_DR);
+#else
-+ DR(LCD_PORT) &= ~(1 << CONTRAST_LINE); // Initializes it low
-+ // GPIO Function for CONTRAST pin (changed in imxfb if contrast is activated)
-+ imx_gpio_mode( GPIO_PORTD | CONTRAST_LINE | GPIO_OUT | GPIO_GIUS | GPIO_DR );
++ /* otherwise use ACD_OE as standard LCD controller signal */
++ imx_gpio_mode(PD12_PF_ACD_OE);
+#endif
+
-+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
-+ // ACD_OE (SHARP_LQ043_POWER_DOWN) used as power down signal
-+ DR(LCD_PORT) &= ~(1 << SHARP_LQ043_POWER_DOWN); // Initializes it Low
-+ imx_gpio_mode( GPIO_PORTD | SHARP_LQ043_POWER_DOWN | GPIO_OUT | GPIO_GIUS | GPIO_DR );
-+#else
-+ // otherwise use ACD_OE as standard LCD controller signal
-+ imx_gpio_mode(PD12_PF_ACD_OE);
-+#endif // CONFIG_FB_IMX_SHARP_LQ043_TFT
++ if (fb_inf->pcr & PCR_TFT)
++ width = 16;
++ else
++ width = 1 << ((fb_inf->pcr >> 28) & 0x3);
++
++ switch (width) {
++ case 16:
++ imx_gpio_mode(PD30_PF_LD15);
++ imx_gpio_mode(PD29_PF_LD14);
++ imx_gpio_mode(PD28_PF_LD13);
++ imx_gpio_mode(PD27_PF_LD12);
++ imx_gpio_mode(PD26_PF_LD11);
++ imx_gpio_mode(PD25_PF_LD10);
++ imx_gpio_mode(PD24_PF_LD9);
++ imx_gpio_mode(PD23_PF_LD8);
++ case 8:
++ imx_gpio_mode(PD22_PF_LD7);
++ imx_gpio_mode(PD21_PF_LD6);
++ imx_gpio_mode(PD20_PF_LD5);
++ imx_gpio_mode(PD19_PF_LD4);
++ case 4:
++ imx_gpio_mode(PD18_PF_LD3);
++ imx_gpio_mode(PD17_PF_LD2);
++ case 2:
++ imx_gpio_mode(PD16_PF_LD1);
++ case 1:
++ imx_gpio_mode(PD15_PF_LD0);
++ }
++
++ imx_gpio_mode(PD6_PF_LSCLK);
++ imx_gpio_mode(PD14_PF_FLM_VSYNC);
++ imx_gpio_mode(PD13_PF_LP_HSYNC);
++
++ /* Sharp's HR TFT displays specific */
++ if (fb_inf->pcr & PCR_SHARP) {
++ imx_gpio_mode(PD7_PF_REV);
++ imx_gpio_mode(PD8_PF_CLS);
++ imx_gpio_mode(PD9_PF_PS);
++ imx_gpio_mode(PD10_PF_SPL_SPR);
++ }
++
++ if (fb_inf->pwmr) {
++ imx_gpio_mode(PD11_PF_CONTRAST);
++ } else {
++ gpio_set_value(CONTRAST_LINE, 0); /* Initializes it Low */
++ /* GPIO Function for CONTRAST pin */
++ imx_gpio_mode(CONTRAST_LINE | GPIO_OUT | GPIO_GIUS | GPIO_DR);
++ }
+}
-+#endif // CONFIG_FB_IMX
+
-+#endif // APF9328_LCD_CONFIG_H
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
---- linux-2.6.27.13.original/arch/arm/mach-imx/include/mach/apf9328.h
-+++ linux-2.6.27.13.mod/arch/arm/mach-imx/include/mach/apf9328.h
++#endif /* CONFIG_FB_IMX */
++
++#endif /* APF9328_LCD_CONFIG_H */
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/apf9328.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/apf9328.h 2009-04-29 15:15:18.000000000 +0200
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
@@ -1007,6 +1069,6 @@
+// USB HOST ISP1760: option available with APF_devfull
+#define ISP1761_BASE IMX_CS3_PHYS
+#define ISP1761_GPIO_IRQ ( GPIO_PORTC | 10 )
-+#define ISP1761_IRQ ( IRQ_GPIOC(10) )
++#define ISP1761_IRQ ( IRQ_GPIOC(10) )
+
+#endif // __ASM_ARCH_APF9328_H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-04-29 07:56:34
|
Revision: 1241
http://armadeus.svn.sourceforge.net/armadeus/?rev=1241&view=rev
Author: thom25
Date: 2009-04-29 07:56:32 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
[LINUX] fix bug in ad9889 OE_ACD pin management
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-04-28 17:20:22 UTC (rev 1240)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-04-29 07:56:32 UTC (rev 1241)
@@ -238,7 +238,7 @@
+
+ apf27_ad9889_fb_data.PA31_GIUS_old_state = 0;
+ /* make sure the LCD OE_ACD pin is correctly configured*/
-+ if( __raw_readl(VA_GPIO_BASE + MXC_GIUS(0)) & 0x80 == 0x80){
++ if( __raw_readl(VA_GPIO_BASE + MXC_GIUS(0)) & 0x80000000){
+ apf27_ad9889_fb_data.PA31_GIUS_old_state = 1;
+ mxc_gpio_mode( PA31_PF_OE_ACD );
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-28 17:20:28
|
Revision: 1240
http://armadeus.svn.sourceforge.net/armadeus/?rev=1240&view=rev
Author: artemys
Date: 2009-04-28 17:20:22 +0000 (Tue, 28 Apr 2009)
Log Message:
-----------
[DEMOS] Makes Qt demo sexier
Modified Paths:
--------------
trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.cpp
trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.h
trunk/software/demos/ApfDacClientServer/src/Client/ApfClientMain.cpp
trunk/software/demos/ApfDacClientServer/src/Client/ApfHostSelectDialog.ui
trunk/software/demos/ApfDacClientServer/src/Client/Vmeters.ui
trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkDefs.h
trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.cpp
trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.h
trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.cpp
trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.h
trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.cpp
trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.h
trunk/software/demos/ApfDacClientServer/src/Server/ApfDacController.cpp
trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.cpp
trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.h
trunk/software/demos/ApfDacClientServer/src/Server/ApfServerListener.cpp
trunk/software/demos/ApfDacClientServer/src/Server/ApfServerMain.cpp
trunk/software/demos/ApfDacClientServer/src/Server/Server.pro
trunk/software/demos/ApfDacClientServer/src/build.sh
Added Paths:
-----------
trunk/software/demos/ApfDacClientServer/src/Server/ApfServerTabDialog.ui
trunk/software/demos/ApfDacClientServer/src/widgets/
trunk/software/demos/ApfDacClientServer/src/widgets/README
trunk/software/demos/ApfDacClientServer/src/widgets/abstractmeter.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/abstractmeter.h
trunk/software/demos/ApfDacClientServer/src/widgets/functions.h
trunk/software/demos/ApfDacClientServer/src/widgets/manometer.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/manometer.h
trunk/software/demos/ApfDacClientServer/src/widgets/qled.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/qled.h
trunk/software/demos/ApfDacClientServer/src/widgets/qslide.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/qslide.h
trunk/software/demos/ApfDacClientServer/src/widgets/thermometer.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/thermometer.h
trunk/software/demos/ApfDacClientServer/src/widgets/widgets.pro
trunk/software/demos/ApfDacClientServer/src/widgets/widgetwithbackground.cpp
trunk/software/demos/ApfDacClientServer/src/widgets/widgetwithbackground.h
Property Changed:
----------------
trunk/software/demos/ApfDacClientServer/src/build.sh
Modified: trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -23,10 +23,10 @@
*/
-#include <iostream>
+#include <iostream>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <QMessageBox>
@@ -60,8 +60,8 @@
setupUi(this);
rightDacControl->setRange(MIN_DAC,MAX_DAC);
leftDacControl->setRange(MIN_DAC,MAX_DAC);
- mPreviousLeft=-1;
- mPreviousRight =-1;
+ mPreviousLeft = -1;
+ mPreviousRight = -1;
connect(&mSocket, SIGNAL(error(QAbstractSocket::SocketError)), this,SLOT(displayError(QAbstractSocket::SocketError)));
connect(&mSocket, SIGNAL(readyRead()), this, SLOT(readData()));
@@ -71,28 +71,29 @@
// connect(rightDacControl, SIGNAL( valueChanged (int ) ), this, SLOT(setRightDac(int )));
// connect(leftDacControl, SIGNAL( valueChanged (int ) ), this, SLOT(setLeftDac(int )));
connect(cancelButton, SIGNAL( clicked ( ) ), this, SLOT(userClose( )));
+ connect(greenLEDBox, SIGNAL(stateChanged(int)), this, SLOT(greenLEDChanged(int)));
+ connect(redLEDBox, SIGNAL(stateChanged(int)), this, SLOT(redLEDChanged(int)));
+ connect(lcdButton, SIGNAL(released()), this, SLOT(updateLCDText()));
show();
mSocket.connectToHost(mHost,mPort);
//if ( mSocket.state() == QAbstractSocket::ConnectedState )
mApfNetworkProtocol = new ApfNetworkProtocol( & mSocket );
+}
-
-
-}
//******************************************************************************
void ApfClient::readData()
{
- qDebug("Read data");
+ qDebug("Read data");
}
//******************************************************************************
void ApfClient::initConnection()
{
- qDebug("Connected");
+ qDebug("Connected");
ApfNetworkOperation NetworkOperation(ApfNetworkProtocol::OpVersionRequest, QString(""));
mApfNetworkProtocol->request( &NetworkOperation );
@@ -103,7 +104,7 @@
void ApfClient::endPeerConnection()
{
- qDebug("Disconnected");
+ qDebug("Disconnected");
if (mSocket.state() == QAbstractSocket::UnconnectedState)
{
@@ -118,7 +119,7 @@
void ApfClient::userClose()
{
- qDebug("Disconnected");
+ qDebug("Disconnected");
disconnect(rightDacControl, SIGNAL( valueChanged (int ) ), this, SLOT(setRightDac(int )));
disconnect(leftDacControl, SIGNAL( valueChanged (int ) ), this, SLOT(setLeftDac(int )));
disconnect(&mSocket, SIGNAL(disconnected()), this, SLOT(endPeerConnection()));
@@ -130,7 +131,7 @@
void ApfClient::timeOut()
{
int value;
- if ( (cnt++%2) == 0)
+ if ((cnt++%2) == 0)
{
value = rightDacControl->value();
if (mPreviousRight != value) setRightDac(value);
@@ -164,9 +165,43 @@
//******************************************************************************
+void ApfClient::greenLEDChanged(int aState)
+{
+ bool state;
+
+ state = aState ? true : false;
+ setLED(0, state);
+}
+
+void ApfClient::redLEDChanged(int aState)
+{
+ bool state;
+
+ state = aState ? true : false;
+ setLED(1, state);
+}
+
+void ApfClient::setLED(int id, int state)
+{
+ ApfNetworkOperation NetworkOperation(ApfNetworkProtocol::OpLed, QString("").sprintf("%d,%d", id, state));
+ mApfNetworkProtocol->request(&NetworkOperation);
+ usleep(80000);
+}
+
+//******************************************************************************
+
+void ApfClient::updateLCDText(void)
+{
+ ApfNetworkOperation NetworkOperation(ApfNetworkProtocol::OpLcd, lcdLineEdit->text());
+ mApfNetworkProtocol->request(&NetworkOperation);
+ usleep(80000);
+}
+
+//******************************************************************************
+
void ApfClient::displayError(QAbstractSocket::SocketError err)
{
- switch (err)
+ switch (err)
{
case QAbstractSocket::RemoteHostClosedError:
break;
@@ -189,4 +224,3 @@
}
close();
}
-
Modified: trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Client/ApfClient.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -43,30 +43,34 @@
public:
- ApfClient( QString host,int port=APF_SOCKET) ;
+ ApfClient( QString host,int port=APF_SOCKET) ;
- virtual ~ApfClient();
+ virtual ~ApfClient();
void run();
protected slots:
void readData();
- void displayError(QAbstractSocket::SocketError err);
+ void displayError(QAbstractSocket::SocketError err);
void setRightDac(int value);
void setLeftDac(int value);
void initConnection();
void endPeerConnection();
void userClose();
void timeOut();
+ void greenLEDChanged(int);
+ void redLEDChanged(int);
+ void setLED(int id, int state);
+ void updateLCDText();
protected:
QString mHost;
int mPort;
- QTcpSocket mSocket;
+ QTcpSocket mSocket;
QTimer mTimer;
int cnt;
int mPreviousLeft,mPreviousRight;
- ApfNetworkProtocol *mApfNetworkProtocol;
+ ApfNetworkProtocol *mApfNetworkProtocol;
};
#endif // __APFCLIENT_H_INCLUDED__
Modified: trunk/software/demos/ApfDacClientServer/src/Client/ApfClientMain.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Client/ApfClientMain.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Client/ApfClientMain.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -1,19 +1,15 @@
//
-// KmAtsMain.cpp
+// ApfClientMain.cpp
//
-// Copyright : (c) 2005 by Kontron Medical
+// Copyright : (c) 2007 Armadeus Project
//
-// Email : in...@ko...
//
-// main for ATS client
-
#include <iostream>
#include <qapplication.h>
#include "ApfHostChooser.h"
#include "ApfClient.h"
-//#include "KmAtsSettings.h"
int main(int argc, char **argv)
{
@@ -24,23 +20,21 @@
ApfHostChooser theApfHostChooser( &cancelled,hostUnderTest );
- theApfHostChooser.initialize();
- theApfHostChooser.show();
+ theApfHostChooser.initialize();
+ theApfHostChooser.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
a.exec();
if (cancelled == true)
{
qDebug("User has cancelled");
return 1;
- }
- else
- {
- ApfClient theApfClient(hostUnderTest);
+ } else {
+ ApfClient theApfClient(hostUnderTest);
- theApfClient.run();
+ theApfClient.run();
qDebug("Selected host: %s",hostUnderTest.toAscii().data());
- a.exec();
- return 0;
-
- }
+ a.exec();
+ return 0;
+ }
}
+
Modified: trunk/software/demos/ApfDacClientServer/src/Client/ApfHostSelectDialog.ui
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Client/ApfHostSelectDialog.ui 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Client/ApfHostSelectDialog.ui 2009-04-28 17:20:22 UTC (rev 1240)
@@ -130,6 +130,11 @@
</item>
<item>
<property name="text" >
+ <string>192.168.0.10</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
<string>192.168.2.30</string>
</property>
</item>
Modified: trunk/software/demos/ApfDacClientServer/src/Client/Vmeters.ui
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Client/Vmeters.ui 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Client/Vmeters.ui 2009-04-28 17:20:22 UTC (rev 1240)
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>400</width>
- <height>188</height>
+ <width>490</width>
+ <height>348</height>
</rect>
</property>
<property name="windowTitle" >
@@ -16,192 +16,302 @@
<property name="windowIcon" >
<iconset>../../../../apf/general/generalResources/iconsAndGraphics/armadeusIcon_50x50.png</iconset>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QFrame" name="frame_3" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
</property>
- <item>
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLineEdit" name="lcdLineEdit" />
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="lcdButton" >
+ <property name="text" >
+ <string>Update</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_2" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="redLEDBox" >
+ <property name="text" >
+ <string>Red LED</string>
</property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="greenLEDBox" >
+ <property name="text" >
+ <string>Green LED</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>9</number>
+ </property>
+ <property name="topMargin" >
+ <number>9</number>
+ </property>
+ <property name="rightMargin" >
+ <number>9</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>9</number>
+ </property>
+ <property name="horizontalSpacing" >
+ <number>6</number>
+ </property>
+ <property name="verticalSpacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="0" column="0" >
- <layout class="QHBoxLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <property name="leftMargin" >
<number>0</number>
</property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::RichText</enum>
+ </property>
+ <property name="pixmap" >
+ <pixmap/>
+ </property>
+ <property name="scaledContents" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="leftDacControl" >
+ <property name="value" >
+ <number>0</number>
+ </property>
+ <property name="sliderPosition" >
+ <number>0</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="invertedAppearance" >
+ <bool>false</bool>
+ </property>
+ <property name="invertedControls" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Left Vmeter</p></body></html></string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <widget class="QLabel" name="label_4" >
+ <property name="autoFillBackground" >
+ <bool>true</bool>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="text" >
+ <string/>
</property>
- <item>
- <widget class="QLabel" name="label_3" >
- <property name="text" >
- <string/>
- </property>
- <property name="textFormat" >
- <enum>Qt::RichText</enum>
- </property>
- <property name="pixmap" >
- <pixmap>vmeter.png</pixmap>
- </property>
- <property name="scaledContents" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSlider" name="leftDacControl" >
- <property name="value" >
- <number>0</number>
- </property>
- <property name="sliderPosition" >
- <number>0</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="invertedAppearance" >
- <bool>false</bool>
- </property>
- <property name="invertedControls" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Left Vmeter</p></body></html></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="pixmap" >
+ <pixmap/>
+ </property>
+ <property name="scaledContents" >
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <widget class="QSlider" name="rightDacControl" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="tickPosition" >
+ <enum>QSlider::NoTicks</enum>
</property>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="autoFillBackground" >
- <bool>true</bool>
- </property>
- <property name="text" >
- <string/>
- </property>
- <property name="pixmap" >
- <pixmap>vmeter.png</pixmap>
- </property>
- <property name="scaledContents" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSlider" name="rightDacControl" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition" >
- <enum>QSlider::NoTicks</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Right Vmeter</p></body></html></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Right Vmeter</p></body></html></string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>71</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Close</string>
+ </property>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="sizeHint" >
+ <size>
+ <width>71</width>
+ <height>31</height>
+ </size>
</property>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>71</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="cancelButton" >
- <property name="text" >
- <string>Close</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>71</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
+ </spacer>
</item>
</layout>
</item>
Modified: trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkDefs.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkDefs.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkDefs.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -27,15 +27,13 @@
#define __APFNETWORKDEFS_H_INCLUDED__
-
namespace ApfNetworkDefs
{
// The Dynamic and/or Private Ports are those from 49152 through 65535
static const unsigned int APF_SOCKET = 50154; //why not ?
- static const unsigned int DATASTREAM_RELEASE = 5;
- static const int MIN_DAC = 0;
- static const int MAX_DAC = 32;
-
+ static const unsigned int DATASTREAM_RELEASE = 5;
+ static const int MIN_DAC = 0;
+ static const int MAX_DAC = 32;
}
-#endif // __APFNETWORKDEFS_H_INCLUDED__
+#endif // __APFNETWORKDEFS_H_INCLUDED__
Modified: trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -30,27 +30,25 @@
ApfNetworkOperation::ApfNetworkOperation( ApfNetworkProtocol::Operation operation,
const QString &arg0, const QString &arg1, const QString &arg2 )
{
- mOperation = operation ;
+ mOperation = operation;
setArg(0, arg0);
setArg(1, arg1);
setArg(2, arg2);
- setState (ApfNetworkProtocol::StWaiting) ;
+ setState (ApfNetworkProtocol::StWaiting);
setErrorCode(ApfNetworkProtocol::NoError);
-
}
ApfNetworkOperation::ApfNetworkOperation( ApfNetworkProtocol::Operation operation,
const QByteArray &arg0, const QByteArray &arg1, const QByteArray &arg2 )
{
- mOperation = operation ;
+ mOperation = operation;
setRawArg(0, arg0);
setRawArg(1, arg1);
setRawArg(2, arg2);
- setState (ApfNetworkProtocol::StWaiting) ;
+ setState (ApfNetworkProtocol::StWaiting);
setErrorCode(ApfNetworkProtocol::NoError);
+}
-}
-
//*****************************************************************************
ApfNetworkOperation::~ApfNetworkOperation()
@@ -75,7 +73,7 @@
void ApfNetworkOperation::setArg( int num, const QString &arg )
{
- if ( num < 3)
+ if (num < 3)
{
mArg[num] = arg;
}
@@ -85,7 +83,7 @@
void ApfNetworkOperation::setRawArg( int num, const QByteArray &arg )
{
- if ( num < 3)
+ if (num < 3)
{
mRawArg[num] = arg;
mRawArg[num].detach();
@@ -96,23 +94,23 @@
void ApfNetworkOperation::appendRawArg( int num, const QByteArray &arg )
{
- if ( num < 3)
+ if (num < 3)
{
- if ( true == mRawArg[num].isNull ())
+ if (true == mRawArg[num].isNull ())
{
- setRawArg(num,arg);
- mRawArg[num].detach();
+ setRawArg(num,arg);
+ mRawArg[num].detach();
}
else
- {
- int previousSize;
- previousSize = mRawArg[num].size();
- mRawArg[num].resize(previousSize + arg.size());
+ {
+ int previousSize;
+ previousSize = mRawArg[num].size();
+ mRawArg[num].resize(previousSize + arg.size());
memcpy (mRawArg[num].data()+ previousSize, arg.data(), arg.size());
}
}
}
-
+
//******************************************************************************
ApfNetworkProtocol::Operation ApfNetworkOperation::operation() const
@@ -124,7 +122,7 @@
QString ApfNetworkOperation::arg( int num ) const
{
- if ( num >2)
+ if (num > 2)
{
num = 0;
}
@@ -135,7 +133,7 @@
QByteArray ApfNetworkOperation::rawArg( int num ) const
{
- if ( num >2)
+ if (num > 2)
{
num = 0;
}
@@ -147,4 +145,3 @@
{
return mState;
}
-
Modified: trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkOperation.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -38,11 +38,10 @@
public:
ApfNetworkOperation( ApfNetworkProtocol::Operation operation,
- const QString &arg0, const QString &arg1=0, const QString &arg2=0 );
+ const QString &arg0, const QString &arg1=0, const QString &arg2=0 );
ApfNetworkOperation( ApfNetworkProtocol::Operation operation,
- const QByteArray &arg0, const QByteArray &arg1=0, const QByteArray &arg2=0 );
-
-
+ const QByteArray &arg0, const QByteArray &arg1=0, const QByteArray &arg2=0 );
+
virtual ~ApfNetworkOperation();
void setState( ApfNetworkProtocol::State state );
@@ -50,24 +49,24 @@
void setArg( int num, const QString &arg );
void setRawArg( int num, const QByteArray &arg );
void appendRawArg( int num, const QByteArray &arg );
-
+
ApfNetworkProtocol::Operation operation() const;
ApfNetworkProtocol::State state() const;
QString arg( int num ) const;
QByteArray rawArg( int num ) const;
-
+
private:
protected:
friend class ApfNetworkProtocol;
-
+
ApfNetworkProtocol::Operation mOperation;
ApfNetworkProtocol::State mState;
ApfNetworkProtocol::Error mErrorCode;
QString mArg[3];
QByteArray mRawArg[3];
-
+
};
#endif // __APFNETWORKOPERATION_H_INCLUDED__
Modified: trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -20,8 +20,9 @@
** ApfNetworkProtocol.cpp
**
** author: ca...@us...
-*/
+*/
+#include <iostream>
#include <unistd.h>
#include "ApfNetworkProtocol.h"
@@ -33,8 +34,7 @@
mDevice(d)
{
mDataStream = new QDataStream(d);
- mDataStream->setVersion(ApfNetworkDefs::DATASTREAM_RELEASE); // Qt 3.1 and more
-
+ mDataStream->setVersion(ApfNetworkDefs::DATASTREAM_RELEASE); // Qt 3.1 and more
}
//******************************************************************************
@@ -44,17 +44,17 @@
delete mDataStream;
}
-//******************************************************************************
-
+//******************************************************************************
+
int ApfNetworkProtocol::request(ApfNetworkOperation *ApfNetworkOperation)
{
Q_CHECK_PTR(ApfNetworkOperation);
-
+
qint32 OP;
- Operation operation(ApfNetworkOperation->operation());
+ Operation operation(ApfNetworkOperation->operation());
OP = (qint32) operation;
- ApfNetworkOperation->setState(StInProgress);
+ ApfNetworkOperation->setState(StInProgress);
ApfNetworkOperation->setErrorCode(NoError);
switch (operation)
@@ -63,42 +63,47 @@
ApfNetworkOperation->setErrorCode(ErrUnsupported);
ApfNetworkOperation->setState(StFailed);
return 0;
+
case OpVersionRequest:
{
*mDataStream << OP;
}
break;
+
case OpDacLeft:
case OpDacRight:
case OpVersion:
+ case OpLed:
+ case OpLcd:
{
- *mDataStream << OP;
- *mDataStream << ApfNetworkOperation->mArg[0].toAscii().data();
+ *mDataStream << OP;
+ *mDataStream << ApfNetworkOperation->mArg[0].toAscii().data();
}
break;
-
- case OpNone:
+
+ case OpNone:
case OpPing:
break;
case OpExitStatus:
return 0;
- };
- if ( mDevice->waitForBytesWritten (10) == true)
+ }
+
+ if (mDevice->waitForBytesWritten(10) == true)
{
ApfNetworkOperation->setErrorCode(ErrIO);
- ApfNetworkOperation->setState(StFailed);
+ ApfNetworkOperation->setState(StFailed);
}
else
{
ApfNetworkOperation->setState(StDone);
}
- return (0);
-
+
+ return (0);
}
-//******************************************************************************
-
+//******************************************************************************
+
int ApfNetworkProtocol::readData(ApfNetworkOperation *ApfNetworkOperation)
{
Q_CHECK_PTR(ApfNetworkOperation);
@@ -106,10 +111,9 @@
qint32 OP;
Operation expectedOperation(ApfNetworkOperation->operation());
-
if (ApfNetworkOperation->mState != StInProgress)
{
- *mDataStream >> OP;
+ *mDataStream >> OP;
if ( (expectedOperation != (Operation) OP) && (ApfNetworkOperation->mState != StWaiting) )
{
qWarning("Expected operation and current operation are different: %d vs. %d", expectedOperation , (Operation)OP);
@@ -121,7 +125,7 @@
}
ApfNetworkOperation->mOperation = (Operation) OP;
ApfNetworkOperation->setErrorCode(NoError);
-
+
switch (OP)
{
default:
@@ -131,45 +135,45 @@
qDebug("WARNING: Unexpected operation received");
emit unexpectedCode();
return -1;
-
- case OpDacLeft:
- case OpDacRight:
+
+ case OpDacLeft:
+ case OpDacRight:
case OpVersion:
- {
- char * ptr =new char [mDevice->size()] ;
+ case OpLed:
+ case OpLcd:
+ {
+ char * ptr =new char [mDevice->size()];
*mDataStream >> ptr;
- ApfNetworkOperation->setArg(0,QString (ptr));
- ApfNetworkOperation->setState (StDone);
+ ApfNetworkOperation->setArg(0, QString (ptr));
+ ApfNetworkOperation->setState(StDone);
delete [] ptr;
}
break;
+
case OpVersionRequest:
- {
- ApfNetworkOperation->setState (StDone);
- }
+ ApfNetworkOperation->setState (StDone);
break;
-
- case OpNone:
- case OpPing:
+ case OpNone:
+ case OpPing:
break;
}
-
- if ( mDataStream->status () != QDataStream::Ok)
+
+ if (mDataStream->status () != QDataStream::Ok)
{
ApfNetworkOperation->setErrorCode(ErrIO);
ApfNetworkOperation->setState(StFailed);
qDebug ("The status is not Ok: %d\n",mDataStream->status ());
- return -1;
+ return -1;
}
- else if ( StDone== ApfNetworkOperation->state())
+ else if (StDone == ApfNetworkOperation->state())
{
emit finished();
}
- return (0);
+ return (0);
}
-//******************************************************************************
+//******************************************************************************
int ApfNetworkProtocol::getIOError()
{
Modified: trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Networking/ApfNetworkProtocol.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -32,32 +32,30 @@
#include <QIODevice>
#include <QDataStream>
-
-
#include "ApfNetworkDefs.h"
-
-
using namespace ApfNetworkDefs;
-
-class ApfNetworkOperation;
+class ApfNetworkOperation;
+
class ApfNetworkProtocol : public QObject
{
Q_OBJECT
-
+
public:
-
- typedef enum Operation
+
+ typedef enum Operation
{
OpNone=0, // no operation (or must be set by protocol)
OpVersion, // get ATS version (compatibility)
- OpVersionRequest, // request ATS version (compatibility)
+ OpVersionRequest, // request ATS version (compatibility)
OpPing, // check if remote is responding
- OpDacLeft, // upload a file
- OpDacRight, // upload a ATS data base file
+ OpDacLeft, // change left DAC value
+ OpDacRight, // change right DAC value
+ OpLed, // switch LEDs state
+ OpLcd, // show text on LCD
OpExitStatus // send process exit status
};
-
+
typedef enum State
{
StWaiting = 0,
@@ -65,18 +63,17 @@
StDone,
StFailed,
StStopped
-
};
+
typedef enum Error
{
// no error
NoError = 0,
ErrUnsupported, // unsupported operation
ErrIO // device error
-
};
-
+
ApfNetworkProtocol(QIODevice * d );
virtual ~ApfNetworkProtocol();
@@ -84,24 +81,19 @@
int request(ApfNetworkOperation *ApfNetworkOperation);
int getIOError(); // get error from last operation
int readData(ApfNetworkOperation *ApfNetworkOperation);
-
-signals:
+
+signals:
void finished();
void unexpectedCode();
void inProgress(int percentDone);
-
+
private:
-
protected:
-
QIODevice *mDevice;
QDataStream *mDataStream;
-
- int mIOError;
+ int mIOError;
};
-
#endif // __APFNETWORKPROTOCOL_H_INCLUDED__
-
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -34,27 +34,26 @@
//******************************************************************************
ApfCore::ApfCore(QTcpSocket *clientConnection, QObject *parent ,const char *):
-QTcpSocket( parent ), mApfCurrentOperation(0), mVersionTransfered(false),
+QTcpSocket( parent ), mApfCurrentOperation(0), mVersionTransfered(false),
mApfDacController( MIN_DAC, MAX_DAC, MIN_DAC, MAX_DAC)
{
- mSocket =clientConnection;
+ mSocket =clientConnection;
mApfNetworkProtocol = new ApfNetworkProtocol(mSocket);
- connect( mSocket, SIGNAL(disconnected()), SLOT(deleteLater()) );
- connect( mSocket, SIGNAL( readyRead()),this, SLOT(data()) );
- connect( mApfNetworkProtocol, SIGNAL( finished()),this, SLOT(exec()) );
- connect( mApfNetworkProtocol, SIGNAL( unexpectedCode()),this, SLOT(protocolError()) );
- QTimer::singleShot ( 10000, this, SLOT(protocolError()) ) ;
- mApfDacController.setbothDAC(MIN_DAC);
-
+ connect( mSocket, SIGNAL(disconnected()), SLOT(deleteLater()) );
+ connect( mSocket, SIGNAL( readyRead()),this, SLOT(data()) );
+ connect( mApfNetworkProtocol, SIGNAL( finished()),this, SLOT(exec()) );
+ connect( mApfNetworkProtocol, SIGNAL( unexpectedCode()),this, SLOT(protocolError()) );
+ QTimer::singleShot ( 10000, this, SLOT(protocolError()) );
+ mApfDacController.setbothDAC(MIN_DAC);
}
//******************************************************************************
ApfCore::~ApfCore()
{
- mApfDacController.setbothDAC(MIN_DAC);
- if ( 0!= mApfNetworkProtocol )
+ mApfDacController.setbothDAC(MIN_DAC);
+ if ( 0 != mApfNetworkProtocol )
{
delete mApfNetworkProtocol;
}
@@ -73,8 +72,8 @@
{
if (mVersionTransfered==false) // huummmm Hacker???
{
- close();
- deleteLater();
+ close();
+ deleteLater();
}
}
@@ -84,10 +83,9 @@
{
if ( mApfCurrentOperation == 0 )
{
- mApfCurrentOperation = new ApfNetworkOperation(ApfNetworkProtocol::OpNone,QString(""));
+ mApfCurrentOperation = new ApfNetworkOperation(ApfNetworkProtocol::OpNone,QString(""));
}
mApfNetworkProtocol->readData(mApfCurrentOperation);
-
}
//******************************************************************************
@@ -95,23 +93,34 @@
void ApfCore::exec()
{
mMessage = QString(tr("command received: "));
+
switch (mApfCurrentOperation->operation())
{
- default:
+ default:
mMessage += QString( tr("unknown operation\n") );
if (mVersionTransfered==false) // huummmm Hacker???
{
close();
}
break;
+
case ApfNetworkProtocol::OpVersionRequest :
- execVersion( mApfCurrentOperation);
- break;
+ execVersion(mApfCurrentOperation);
+ break;
+
case ApfNetworkProtocol::OpDacLeft :
case ApfNetworkProtocol::OpDacRight :
- execSetDac( mApfCurrentOperation);
- break;
- }
+ execSetDac(mApfCurrentOperation);
+ break;
+
+ case ApfNetworkProtocol::OpLed :
+ execSetLed(mApfCurrentOperation);
+ break;
+
+ case ApfNetworkProtocol::OpLcd :
+ execSetLcd(mApfCurrentOperation);
+ break;
+ }
emit logText(mMessage);
delete mApfCurrentOperation;
mApfCurrentOperation = 0;
@@ -120,36 +129,61 @@
//******************************************************************************
void ApfCore::execVersion(ApfNetworkOperation *)
-{
+{
mMessage += QString(tr("Get version\n"));
mVersionTransfered = true;
- ApfNetworkOperation VersionNetworkOperation(ApfNetworkProtocol::OpVersion,QString("1.0"));
+ ApfNetworkOperation VersionNetworkOperation(ApfNetworkProtocol::OpVersion,QString("1.0"));
mApfNetworkProtocol->request(&VersionNetworkOperation);
- if ( mApfDacController.isOpen() == false)
+ if (mApfDacController.isOpen() == false)
{
- mMessage += QString(tr("Warning: The i2c bus is not accessible"));
+ mMessage += QString(tr("Warning: The i2c bus is not accessible"));
}
else
{
- mMessage += QString(tr("Info: The i2c bus is accessible"));
+ mMessage += QString(tr("Info: The i2c bus is accessible"));
}
}
+
//******************************************************************************
void ApfCore::execSetDac(ApfNetworkOperation *ApfNetworkOperation)
{
QString value = ApfNetworkOperation->arg(0);
- int val = value.toInt();
+ int val = value.toInt();
if ( ApfNetworkOperation->operation() == ApfNetworkProtocol::OpDacLeft )
{
mMessage += QString(tr("Set left DAC operation : value = ")) + value;
mApfDacController.setLeftDAC(val);
+ emit setManometerValue(val * 10);
}
else
{
mMessage += QString(tr("Set right DAC operation : value = ")) + value;
mApfDacController.setRightDAC(val);
+ emit setThermometerValue(val * 3);
}
}
+
+//******************************************************************************
+
+void ApfCore::execSetLed(ApfNetworkOperation *ApfNetworkOperation)
+{
+ QString arg = ApfNetworkOperation->arg(0);
+ QString led = arg.left(1);
+ QString state = arg.right(1);
+
+ mMessage += QString(tr("Set LED operation : value = ")) + led + " " + state;
+ emit setLedValue(led.toInt(), (state.toInt() ? true : false));
+}
+
+//******************************************************************************
+
+void ApfCore::execSetLcd(ApfNetworkOperation *ApfNetworkOperation)
+{
+ QString text = ApfNetworkOperation->arg(0);
+
+ mMessage += QString(tr("Set LCD text : ")) + text;
+ emit updateText(text);
+}
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfCore.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -36,10 +36,10 @@
class ApfCore : public QTcpSocket
{
Q_OBJECT
-
+
public:
- ApfCore(QTcpSocket *clientConnection, QObject *parent=0, const char *name=0 );
+ ApfCore(QTcpSocket *clientConnection, QObject *parent=0, const char *name=0);
virtual ~ApfCore();
@@ -48,26 +48,34 @@
// output debug messages
void logText( const QString& );
void ApfCoreFinished();
-
+ void setLedValue(int id, bool state);
+ void setManometerValue(int id);
+ void setThermometerValue(int id);
+ void updateText(const QString &);
+
public slots:
void exec();
void data();
void deleteLater();
- void protocolError();
+ void protocolError();
private:
-
QString mMessage;
-
+
protected:
ApfNetworkProtocol *mApfNetworkProtocol;
ApfNetworkOperation *mApfCurrentOperation;
bool mVersionTransfered;
- void execVersion(ApfNetworkOperation *ApfNetworkOperation);
- void execSetDac(ApfNetworkOperation *ApfNetworkOperation);
- QTcpSocket *mSocket;
- ApfDacController mApfDacController;
+
+ void execVersion(ApfNetworkOperation*);
+ void execSetDac(ApfNetworkOperation*);
+ void execSetLed(ApfNetworkOperation*);
+ void execSetLcd(ApfNetworkOperation*);
+
+ QTcpSocket *mSocket;
+ ApfDacController mApfDacController;
};
+
#endif // __APFCORE_H_INCLUDED__
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfDacController.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfDacController.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfDacController.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -79,6 +79,7 @@
void ApfDacController::setLeftDAC(int value)
{
unsigned char buf[2];
+
if ( (mOpen==true) && (value>= mMinLeft) && (value <= mMaxLeft) )
{
value = (value * MAX5821M_MAX_DATA_VALUE) / (mMaxLeft-mMinLeft);
@@ -89,10 +90,9 @@
mDACOutput.command = MAX5821_LOAD_DAC_A_IN_REG_B ;
mDACOutput.data = value;
Build_extended_command( mPowerUpCommand, buf);
- write (mI2cBus, buf,2);
+ write (mI2cBus, buf,2);
Build_data_command(mDACOutput,buf);
- write (mI2cBus, buf,2);
-
+ write (mI2cBus, buf,2);
}
}
@@ -108,12 +108,12 @@
// printf("Set the right DAC : %d\n", value);
mPowerUpCommand.ctrlA = POWER_CTRL_UNSELECTED;
mPowerUpCommand.ctrlB = POWER_CTRL_SELECTED;
- mDACOutput.command = MAX5821_LOAD_DAC_B_IN_REG_A ;
+ mDACOutput.command = MAX5821_LOAD_DAC_B_IN_REG_A;
mDACOutput.data = value;
Build_extended_command( mPowerUpCommand, buf);
- write (mI2cBus, buf,2);
+ write (mI2cBus, buf,2);
Build_data_command(mDACOutput,buf);
- write (mI2cBus, buf,2);
+ write (mI2cBus, buf,2);
}
}
@@ -133,11 +133,10 @@
mDACOutput.command = MAX5821_LOAD_DAC_ALL_IN_UPDATE_ALL ;
mDACOutput.data = value;
Build_extended_command( mPowerUpCommand, buf);
- write (mI2cBus, buf,2);
+ write (mI2cBus, buf,2);
Build_data_command(mDACOutput,buf);
- write (mI2cBus, buf,2);
+ write (mI2cBus, buf,2);
}
-
}
//******************************************************************************
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -20,7 +20,7 @@
** ApfServer.cpp
**
** author: ca...@us...
-*/
+*/
#include <iostream>
@@ -49,32 +49,44 @@
//******************************************************************************
#ifndef NOSERVERGUI
-
-ApfServer::ApfServer(): QDialog(),mApfServerListener()
+ApfServer::ApfServer(): QDialog(), mApfServerListener()
#else
ApfServer::ApfServer() : mApfServerListener()
#endif
-
{
-
#ifndef NOSERVERGUI
- setupUi(this);
+ setupUi(this);
+ mRedLed = new QLed(tab_2);
+ mRedLed->setColor(QColor(200,0,0));
+ mGreenLed = new QLed(tab_2);
+ mGreenLed->setColor(QColor(0,200,0));
+ mSlide = new QSlide(tab_2);
+ mSlide->startTmr(true);
+ mManometer = new ManoMeter(tab_2);
+ mThermometer = new ThermoMeter(tab_2);
+ mWidgetsLayout = new QGridLayout(tab_2);
+ mWidgetsLayout->addWidget(mRedLed, 0, 0);
+ mWidgetsLayout->addWidget(mGreenLed, 2, 0);
+ QSpacerItem* spacerItem = new QSpacerItem(20, 80, QSizePolicy::Minimum, QSizePolicy::Expanding);
+ mWidgetsLayout->addItem(spacerItem, 1, 0);
+ mWidgetsLayout->addWidget(mManometer, 1, 1, 2, 1);
+ mWidgetsLayout->addWidget(mSlide, 0, 1);
+ mWidgetsLayout->addWidget(mThermometer, 0, 2, 3, 1);
#endif
mApfServerListener = new ApfServerListener(0);
- PutServerDebugMessage(QString("Starting Apf server"));
+ PutServerDebugMessage(QString("Starting Apf server"));
connect( mApfServerListener, SIGNAL( logText(const QString &) ), SLOT(PutServerDebugMessage(const QString &)) );
#ifndef NOSERVERGUI
connect( QuitButton, SIGNAL(clicked()), this, SLOT(EndServer()) );
- #endif
- gApfServer = this;
-
+#endif
+ gApfServer = this;
}
//******************************************************************************
ApfServer *ApfServer::getApfServerInstance()
{
- return gApfServer;
+ return gApfServer;
}
//******************************************************************************
@@ -82,43 +94,91 @@
void ApfServer::EndServer()
{
#ifndef NOSERVERGUI
- hide();
+ hide();
qApp->exit(0);
#else
- exit(0);
+ exit(0);
#endif
}
-
//******************************************************************************
ApfServer::~ApfServer()
{
- if ( 0 != mApfServerListener)
- {
+ if (0 != mApfServerListener)
+ {
delete mApfServerListener;
- }
+ }
}
//******************************************************************************
void ApfServer::PutServerDebugMessage(const char * str)
{
- PutServerDebugMessage (QString(str)) ;
+ PutServerDebugMessage (QString(str));
}
//******************************************************************************
void ApfServer::PutServerDebugMessage(const QString & str)
{
+#ifndef NOSERVERGUI
+ if (mTextEdit)
+ {
+ mTextEdit->append(str);
+ }
+#else
+ std::cout << str.toAscii().data() << std::endl;
+#endif
+}
+//******************************************************************************
+
+void ApfServer::setLedValue(int id, bool state)
+{
#ifndef NOSERVERGUI
-
- if (mTextEdit)
- {
- mTextEdit->append(str);
- }
+ if (id == 0)
+ {
+ mGreenLed->setValue(state);
+ }
+ else
+ {
+ mRedLed->setValue(state);
+ }
#else
- std::cout << str.toAscii().data() << std::endl;
+ std::cout << "Setting " << (id ? "Red" : "Green") << " LED to " << state << std::endl;
#endif
}
+
+//******************************************************************************
+
+void ApfServer::setManometerValue(int value)
+{
+#ifndef NOSERVERGUI
+ mManometer->setValue(value);
+#else
+ std::cout << "Setting Manometer to " << value << std::endl;
+#endif
+}
+
+//******************************************************************************
+
+void ApfServer::setThermometerValue(int value)
+{
+#ifndef NOSERVERGUI
+ mThermometer->setValue(value);
+#else
+ std::cout << "Setting Thermometer to " << value << std::endl;
+#endif
+}
+
+//******************************************************************************
+
+void ApfServer::setSlideText(const QString & atext)
+{
+#ifndef NOSERVERGUI
+ mSlide->setText(atext);
+#else
+ std::cout << "Setting LCD text to " << atext.toAscii().data() << std::endl;
+#endif
+}
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.h
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.h 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfServer.h 2009-04-28 17:20:22 UTC (rev 1240)
@@ -1,4 +1,3 @@
-
/*
** THE ARMADEUS PROJECT
**
@@ -21,7 +20,7 @@
** ApfServer.h
**
** author: ca...@us...
-*/
+*/
#ifndef __APFSERVER_H_INCLUDED__
@@ -40,24 +39,28 @@
#ifndef NOSERVERGUI
#include <QDialog>
#include <qpushbutton.h>
-#include "ui_ApfServerDialog.h"
+#include "ui_ApfServerTabDialog.h"
+#include "../widgets/qled.h"
+#include "../widgets/manometer.h"
+#include "../widgets/thermometer.h"
+#include "../widgets/qslide.h"
#endif
class ApfServerListener;
-using namespace ApfNetworkDefs;
+using namespace ApfNetworkDefs;
#ifndef NOSERVERGUI
-class ApfServer : public QDialog , public Ui::ApfServerDialog
+class ApfServer : public QDialog, public Ui::ApfServerTabDialog
#else
class ApfServer : public QObject
#endif
{
Q_OBJECT
-
+
public:
- ApfServer( );
+ ApfServer( );
virtual ~ApfServer();
void PutServerDebugMessage(const char * str);
static ApfServer *getApfServerInstance();
@@ -66,7 +69,11 @@
void PutServerDebugMessage(const QString & str);
void EndServer();
-
+ void setLedValue(int id, bool);
+ void setManometerValue(int);
+ void setThermometerValue(int);
+ void setSlideText(const QString &);
+
private:
ApfServerListener *mApfServerListener;
@@ -77,6 +84,14 @@
protected:
static ApfServer * gApfServer;
+#ifndef NOSERVERGUI
+ QLed* mRedLed;
+ QLed* mGreenLed;
+ ManoMeter* mManometer;
+ ThermoMeter* mThermometer;
+ QGridLayout* mWidgetsLayout;
+ QSlide* mSlide;
+#endif
};
+
#endif // __APFSERVER_H_INCLUDED__
-
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfServerListener.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfServerListener.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfServerListener.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -38,10 +38,10 @@
QTcpServer( parent ),mApfCore(0),mParent(parent)
{
connect( this, SIGNAL( newConnection() ),this, SLOT( newIncommingConnection() ) );
-
- bool ok= listen ( QHostAddress::Any, APF_SOCKET );
+
+ bool ok = listen(QHostAddress::Any, APF_SOCKET);
// bool ok =setSocketDescriptor (APF_SOCKET);
- if ( !ok )
+ if ( !ok )
{
qWarning("Failed to bind to port %d", APF_SOCKET);
exit(1);
@@ -56,42 +56,40 @@
//******************************************************************************
-void ApfServerListener::newIncommingConnection()
-
+void ApfServerListener::newIncommingConnection()
{
-
- emit logText(QString("").sprintf("Incoming connexion on port %d",APF_SOCKET));
+ emit logText(QString("").sprintf("Incoming connexion on port %d",APF_SOCKET));
if ( 0 == mApfCore )
{
QTcpSocket *clientConnection = this->nextPendingConnection();
-
- emit logText(QString("").sprintf("Starting the APF core"));
+
+ emit logText(QString("").sprintf("Starting the APF core"));
mApfCore = new ApfCore (clientConnection, this);
- connect( mApfCore, SIGNAL( logText(const QString &) ), ApfServer::getApfServerInstance() ,SLOT(PutServerDebugMessage(const QString &)) );
+ connect( mApfCore, SIGNAL( logText(const QString &) ), ApfServer::getApfServerInstance(),
+ SLOT(PutServerDebugMessage(const QString &)) );
connect( mApfCore, SIGNAL( ApfCoreFinished() ), SLOT( coreDestroyed() ) );
-
+ connect( mApfCore, SIGNAL(setLedValue(int, bool)), ApfServer::getApfServerInstance(), SLOT(setLedValue(int, bool)) );
+ connect( mApfCore, SIGNAL(setManometerValue(int)), ApfServer::getApfServerInstance(), SLOT(setManometerValue(int)) );
+ connect( mApfCore, SIGNAL(setThermometerValue(int)), ApfServer::getApfServerInstance(), SLOT(setThermometerValue(int)) );
+ connect( mApfCore, SIGNAL(updateText(const QString &)), ApfServer::getApfServerInstance(), SLOT(setSlideText(const QString &)) );
}
else
{
- emit logText(QString("").sprintf("APF core allready started. closing socket"));
+ emit logText(QString("").sprintf("APF core already started. closing socket"));
close();
}
-
}
//******************************************************************************
void ApfServerListener::coreDestroyed()
-
{
-
if ( 0 != mApfCore )
{
emit logText(QString("").sprintf("APF core stopped\n"));
delete mApfCore;
- mApfCore =0;
+ mApfCore = 0;
}
usleep(2000000);
}
-
Modified: trunk/software/demos/ApfDacClientServer/src/Server/ApfServerMain.cpp
===================================================================
--- trunk/software/demos/ApfDacClientServer/src/Server/ApfServerMain.cpp 2009-04-28 14:09:54 UTC (rev 1239)
+++ trunk/software/demos/ApfDacClientServer/src/Server/ApfServerMain.cpp 2009-04-28 17:20:22 UTC (rev 1240)
@@ -32,6 +32,9 @@
#ifndef NOSERVERGUI
#include <QApplication>
+# ifdef Q_WS_QWS
+#include <QWSServer>
+# endif
#else
#include <QCoreApplication>
#endif
@@ -42,32 +45,31 @@
//using namespace std;
-void runAsDaemon()
+void runAsDaemon()
{
+ int pid( fork());
- int pid( fork());
-
- if (pid < 0)
+ if (pid < 0)
{
exit(EXIT_FAILURE);
}
/* If we got a good PID, then
we can exit the parent process. */
- if (pid > 0)
+ if (pid > 0)
{
exit(EXIT_SUCCESS);
}
sleep(2);
umask(0);
int sid (setsid());
- if (sid < 0)
+ if (sid < 0)
{
/* Log the failure */
exit(EXIT_FAILURE);
- }
-
+ }
+
/* Change the current working directory */
- if ((chdir("/")) < 0)
+ if ((chdir("/")) < 0)
{
/* Log the failure */
exit(EXIT_FAILURE);
@@ -76,27 +78,31 @@
/* Close out the standar...
[truncated message content] |
|
From: <ar...@us...> - 2009-04-28 14:10:01
|
Revision: 1239
http://armadeus.svn.sourceforge.net/armadeus/?rev=1239&view=rev
Author: artemys
Date: 2009-04-28 14:09:54 +0000 (Tue, 28 Apr 2009)
Log Message:
-----------
[BUILDROOT] Fixes php download site
Added Paths:
-----------
trunk/patches/073-buildroot-php-fixes_download_site.diff
Added: trunk/patches/073-buildroot-php-fixes_download_site.diff
===================================================================
--- trunk/patches/073-buildroot-php-fixes_download_site.diff (rev 0)
+++ trunk/patches/073-buildroot-php-fixes_download_site.diff 2009-04-28 14:09:54 UTC (rev 1239)
@@ -0,0 +1,11 @@
+--- buildroot/package/php/php.mk.org 2009-04-28 15:45:51.000000000 +0200
++++ buildroot/package/php/php.mk 2009-04-28 15:57:47.000000000 +0200
+@@ -5,7 +5,7 @@
+ #############################################################
+ PHP_VER:=5.2.6
+ PHP_SOURCE:=php-$(PHP_VER).tar.bz2
+-PHP_SITE:=http://us.php.net/get/${PHP_SOURCE}/from/us2.php.net/mirror
++PHP_SITE:=http://museum.php.net/php5/$(PHP_SOURCE)
+ PHP_DIR:=$(BUILD_DIR)/php-$(PHP_VER)
+ PHP_CAT=$(BZCAT)
+ PHP_DEPS=
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-27 14:51:23
|
Revision: 1238
http://armadeus.svn.sourceforge.net/armadeus/?rev=1238&view=rev
Author: artemys
Date: 2009-04-27 14:51:14 +0000 (Mon, 27 Apr 2009)
Log Message:
-----------
[DEBUG] Cleanup fpgaregs and applies Coding Rules
Modified Paths:
--------------
trunk/target/linux/debug/fpgaregs/fpgaregs.c
Modified: trunk/target/linux/debug/fpgaregs/fpgaregs.c
===================================================================
--- trunk/target/linux/debug/fpgaregs/fpgaregs.c 2009-04-22 17:07:15 UTC (rev 1237)
+++ trunk/target/linux/debug/fpgaregs/fpgaregs.c 2009-04-27 14:51:14 UTC (rev 1238)
@@ -1,15 +1,12 @@
/************************************************************************
- * a program to write/read 16/32bits values on fpga address map using mmap()
- * 11 october 2008
- * fpgaregs_mmap.c
*
+ * fpgaregs.c
+ * a program to write/read 16/32 bits values on FPGA address map using mmap()
+ *
* (c) Copyright 2008 Armadeus project
* Fabien Marteau <fab...@ar...>
* Modified by Sebastien Van Cauwenberghe <sv...@gm...>
*
- * A simple driver for reading and writing on
- * fpga through the character file /dev/mem
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -53,12 +50,13 @@
#define WORD_ACCESS (2)
#define LONG_ACCESS (4)
+
void displayResult(char* text, unsigned int accesstype, unsigned int value, unsigned int address)
{
- if( accesstype == WORD_ACCESS )
- printf("%s %04x at %08x\n",text, (unsigned short)value,address);
+ if (accesstype == WORD_ACCESS)
+ printf("%s %04x at %08x\n", text, (unsigned short)value, address);
else
- printf("%s %08x at %08x\n",text, value,address);
+ printf("%s %08x at %08x\n", text, value, address);
}
@@ -69,49 +67,46 @@
int ffpga, accesstype = LONG_ACCESS;
void* ptr_fpga;
- if ((argc < 3) || (argc > 4)){
+ if ((argc < 3) || (argc > 4)) {
printf("invalid arguments number\nfpgaregs [w,l] fpga_reg_add [value].\n\tw: word access, l: long access\n\
\tEx: fpgaregs w 0x10 0x1234, fpgaregs l 0x10 0x12345678\n");
return -1;
}
- ffpga=open("/dev/mem",O_RDWR|O_SYNC);
- if(ffpga<0){
+ ffpga = open("/dev/mem", O_RDWR|O_SYNC);
+ if (ffpga < 0) {
printf("can't open file /dev/mem\n");
return -1;
}
-
- ptr_fpga = mmap (0, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, ffpga, FPGA_ADDRESS);
- if (ptr_fpga == MAP_FAILED)
- {
- printf ("mmap failed\n");
+ ptr_fpga = mmap(0, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, ffpga, FPGA_ADDRESS);
+ if (ptr_fpga == MAP_FAILED) {
+ printf("mmap failed\n");
return -1;
}
address = (unsigned int)strtol(argv[2], (char **)NULL, 16);
- if(argc<3){
+ if (argc < 3) {
printf("invalid command line");
- }
- else {
- if( *(argv[1]) == 'w' )
+ } else {
+ if (*(argv[1]) == 'w')
accesstype = WORD_ACCESS;
- if(accesstype == WORD_ACCESS){
- if(address%2 != 0){
- printf("Can't read word in even address (%d)\n",address);
+ if (accesstype == WORD_ACCESS) {
+ if (address%2 != 0) {
+ printf("Can't read word in even address (%d)\n", address);
return -1;
}
- }else{ /* LONG_ACCESS */
- if(address%4 != 0){
- printf("Can't read long in no-4-multiple address (%d)\n",address);
+ } else { /* LONG_ACCESS */
+ if (address%4 != 0) {
+ printf("Can't read long in no-4-multiple address (%d)\n", address);
return -1;
}
}
/* write value at address */
- if(argc == 4){
- value = strtoul(argv[3], (char **)NULL, 16);
+ if (argc == 4) {
+ value = strtoul(argv[3], (char **)NULL, 16);
if (accesstype == WORD_ACCESS)
*(unsigned short*)(ptr_fpga+(address)) = (unsigned short)value;
else
@@ -120,7 +115,7 @@
displayResult("Write", accesstype, value, address);
/* read address value */
- }else if(argc == 3){
+ } else if (argc == 3) {
if (accesstype == WORD_ACCESS)
value = *(unsigned short*)(ptr_fpga+(address));
else
@@ -132,4 +127,3 @@
close(ffpga);
return 0;
}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-04-22 17:07:39
|
Revision: 1237
http://armadeus.svn.sourceforge.net/armadeus/?rev=1237&view=rev
Author: FabM
Date: 2009-04-22 17:07:15 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
[BUILDROOT] fpgaregs : check address conformity. ticket #44
Modified Paths:
--------------
trunk/target/linux/debug/fpgaregs/fpgaregs.c
Modified: trunk/target/linux/debug/fpgaregs/fpgaregs.c
===================================================================
--- trunk/target/linux/debug/fpgaregs/fpgaregs.c 2009-04-22 11:49:17 UTC (rev 1236)
+++ trunk/target/linux/debug/fpgaregs/fpgaregs.c 2009-04-22 17:07:15 UTC (rev 1237)
@@ -55,70 +55,81 @@
void displayResult(char* text, unsigned int accesstype, unsigned int value, unsigned int address)
{
- if( accesstype == WORD_ACCESS )
- printf("%s %04x at %08x\n",text, (unsigned short)value,address);
- else
- printf("%s %08x at %08x\n",text, value,address);
+ if( accesstype == WORD_ACCESS )
+ printf("%s %04x at %08x\n",text, (unsigned short)value,address);
+ else
+ printf("%s %08x at %08x\n",text, value,address);
}
int main(int argc, char *argv[])
{
- unsigned short address;
- unsigned int value;
- int ffpga, accesstype = LONG_ACCESS;
- void* ptr_fpga;
+ unsigned short address;
+ unsigned int value;
+ int ffpga, accesstype = LONG_ACCESS;
+ void* ptr_fpga;
- if ((argc < 3) || (argc > 4)){
- printf("invalid arguments number\nfpgaregs [w,l] fpga_reg_add [value].\n\tw: word access, l: long access\n\
-\tEx: fpgaregs w 0x10 0x1234, fpgaregs l 0x10 0x12345678\n");
- return -1;
- }
+ if ((argc < 3) || (argc > 4)){
+ printf("invalid arguments number\nfpgaregs [w,l] fpga_reg_add [value].\n\tw: word access, l: long access\n\
+ \tEx: fpgaregs w 0x10 0x1234, fpgaregs l 0x10 0x12345678\n");
+ return -1;
+ }
- ffpga=open("/dev/mem",O_RDWR|O_SYNC);
- if(ffpga<0){
- printf("can't open file /dev/mem\n");
- return -1;
- }
+ ffpga=open("/dev/mem",O_RDWR|O_SYNC);
+ if(ffpga<0){
+ printf("can't open file /dev/mem\n");
+ return -1;
+ }
- ptr_fpga = mmap (0, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, ffpga, FPGA_ADDRESS);
- if (ptr_fpga == MAP_FAILED)
- {
- printf ("mmap failed\n");
- return -1;
- }
+ ptr_fpga = mmap (0, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, ffpga, FPGA_ADDRESS);
+ if (ptr_fpga == MAP_FAILED)
+ {
+ printf ("mmap failed\n");
+ return -1;
+ }
- address = (unsigned int)strtol(argv[2], (char **)NULL, 16);
+ address = (unsigned int)strtol(argv[2], (char **)NULL, 16);
- if(argc<3){
- printf("invalid command line");
- }
- else {
- if( *(argv[1]) == 'w' )
- accesstype = WORD_ACCESS;
-
- /* write value at address */
- if(argc == 4){
- value = strtoul(argv[3], (char **)NULL, 16);
- if (accesstype == WORD_ACCESS)
- *(unsigned short*)(ptr_fpga+(address)) = (unsigned short)value;
- else
- *(unsigned int*)(ptr_fpga+(address)) = (unsigned int)value;
+ if(argc<3){
+ printf("invalid command line");
+ }
+ else {
+ if( *(argv[1]) == 'w' )
+ accesstype = WORD_ACCESS;
+ if(accesstype == WORD_ACCESS){
+ if(address%2 != 0){
+ printf("Can't read word in even address (%d)\n",address);
+ return -1;
+ }
+ }else{ /* LONG_ACCESS */
+ if(address%4 != 0){
+ printf("Can't read long in no-4-multiple address (%d)\n",address);
+ return -1;
+ }
+ }
- displayResult("Write", accesstype, value, address);
-
- /* read address value */
- }else if(argc == 3){
- if (accesstype == WORD_ACCESS)
- value = *(unsigned short*)(ptr_fpga+(address));
- else
- value = *(unsigned int*)(ptr_fpga+(address));
-
- displayResult("Read", accesstype, value, address);
- }
- }
- close(ffpga);
- return 0;
+ /* write value at address */
+ if(argc == 4){
+ value = strtoul(argv[3], (char **)NULL, 16);
+ if (accesstype == WORD_ACCESS)
+ *(unsigned short*)(ptr_fpga+(address)) = (unsigned short)value;
+ else
+ *(unsigned int*)(ptr_fpga+(address)) = (unsigned int)value;
+
+ displayResult("Write", accesstype, value, address);
+
+ /* read address value */
+ }else if(argc == 3){
+ if (accesstype == WORD_ACCESS)
+ value = *(unsigned short*)(ptr_fpga+(address));
+ else
+ value = *(unsigned int*)(ptr_fpga+(address));
+
+ displayResult("Read", accesstype, value, address);
+ }
+ }
+ close(ffpga);
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-04-22 11:49:20
|
Revision: 1236
http://armadeus.svn.sourceforge.net/armadeus/?rev=1236&view=rev
Author: FabM
Date: 2009-04-22 11:49:17 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
[FIRMWARE] cleaning BRAMTest
Added Paths:
-----------
trunk/firmware/BRAMTest/bin/
trunk/firmware/BRAMTest/bin/BRAMTEST_APF27_200k.bit
trunk/firmware/BRAMTest/bin/BRAMTEST_APF9328_200k.bit
trunk/firmware/BRAMTest/src/
trunk/firmware/BRAMTest/src/BRAMTest.vhdl
trunk/firmware/BRAMTest/src/BRAMTest_APF27.ucf
trunk/firmware/BRAMTest/src/BRAMTest_APF9328.ucf
Removed Paths:
-------------
trunk/firmware/BRAMTest/BRAMTest.ucf
trunk/firmware/BRAMTest/BRAMTest.vhdl
trunk/firmware/BRAMTest/BRAMTest_APF.ucf
trunk/firmware/BRAMTest/BRAMtest.ise
trunk/firmware/BRAMTest/bramtest_top.bin
trunk/firmware/BRAMTest/bramtest_top_APF.bin
Deleted: trunk/firmware/BRAMTest/BRAMTest.ucf
===================================================================
--- trunk/firmware/BRAMTest/BRAMTest.ucf 2009-04-22 09:09:35 UTC (rev 1235)
+++ trunk/firmware/BRAMTest/BRAMTest.ucf 2009-04-22 11:49:17 UTC (rev 1236)
@@ -1,72 +0,0 @@
-NET "AddrxDI<10>" LOC = "P33";
-NET "AddrxDI<11>" LOC = "P35";
-NET "AddrxDI<12>" LOC = "P36";
-NET "User<0>" LOC = "P92" ;
-NET "User<1>" LOC = "P93" ;
-NET "User<2>" LOC = "P95" ;
-NET "User<3>" LOC = "P96" ;
-NET "User<4>" LOC = "P97" ;
-NET "User<5>" LOC = "P98" ;
-NET "User<6>" LOC = "P99" ;
-NET "User<7>" LOC = "P100" ;
-NET "User<8>" LOC = "P102" ;
-NET "User<9>" LOC = "P103" ;
-NET "User<10>" LOC = "P104" ;
-NET "User<11>" LOC = "P105" ;
-NET "User<12>" LOC = "P107" ;
-NET "User<13>" LOC = "P108" ;
-NET "User<14>" LOC = "P112" ;
-NET "User<15>" LOC = "P113" ;
-NET "User<16>" LOC = "P116" ;
-NET "User<17>" LOC = "P118" ;
-NET "User<18>" LOC = "P119" ;
-NET "User<19>" LOC = "P122" ;
-#NET "ResetxRB" LOC = "P123" ;
-NET "ClkxCI" TNM_NET = "ClkxCI";
-TIMESPEC "TS_ClkxCI" = PERIOD "ClkxCI" 10 ns HIGH 50 %;
-
-#PACE: Start of Constraints generated by PACE
-
-#PACE: Start of PACE I/O Pin Assignments
-NET "AddrxDI<0>" LOC = "P21" ;
-NET "AddrxDI<1>" LOC = "P23" ;
-NET "AddrxDI<2>" LOC = "P24" ;
-NET "AddrxDI<3>" LOC = "P25" ;
-NET "AddrxDI<4>" LOC = "P26" ;
-NET "AddrxDI<5>" LOC = "P27" ;
-NET "AddrxDI<6>" LOC = "P28" ;
-NET "AddrxDI<7>" LOC = "P30" ;
-NET "AddrxDI<8>" LOC = "P31" ;
-NET "AddrxDI<9>" LOC = "P32" ;
-NET "ClkxCI" LOC = "P55" ;
-NET "CSxBI" LOC = "P44" ;
-NET "DataxD<0>" LOC = "P1" ;
-NET "DataxD<10>" LOC = "P13" ;
-NET "DataxD<11>" LOC = "P14" ;
-NET "DataxD<12>" LOC = "P15" ;
-NET "DataxD<13>" LOC = "P17" ;
-NET "DataxD<14>" LOC = "P18" ;
-NET "DataxD<15>" LOC = "P20" ;
-NET "DataxD<1>" LOC = "P2" ;
-NET "DataxD<2>" LOC = "P4" ;
-NET "DataxD<3>" LOC = "P5" ;
-NET "DataxD<4>" LOC = "P6" ;
-NET "DataxD<5>" LOC = "P7" ;
-NET "DataxD<6>" LOC = "P8" ;
-NET "DataxD<7>" LOC = "P10" ;
-NET "DataxD<8>" LOC = "P11" ;
-NET "DataxD<9>" LOC = "P12" ;
-NET "WRxBI" LOC = "P46" ;
-NET "RDxBI" LOC = "P47" ;
-NET "IOL30P4" LOC = "P59" ;
-NET "IOL30N4" LOC = "P60" ;
-NET "IOL27P4" LOC = "P63" ;
-NET "IOL01P4_VRN4" LOC = "P68" ;
-NET "IOL01N4_VRN4" LOC = "P69" ;
-NET "IO_VREF4" LOC = "P70" ;
-
-#PACE: Start of PACE Area Constraints
-
-#PACE: Start of PACE Prohibit Constraints
-
-#PACE: End of Constraints generated by PACE
Deleted: trunk/firmware/BRAMTest/BRAMTest.vhdl
===================================================================
--- trunk/firmware/BRAMTest/BRAMTest.vhdl 2009-04-22 09:09:35 UTC (rev 1235)
+++ trunk/firmware/BRAMTest/BRAMTest.vhdl 2009-04-22 11:49:17 UTC (rev 1236)
@@ -1,156 +0,0 @@
-----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: michael lerjen
---
--- Create Date: 22:04:02 04/12/2006
--- Design Name:
--- Module Name:
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
---
--- Dependencies:
---
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
---
-----------------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-library UNISIM;
-use UNISIM.VComponents.all;
-
-entity BRAMTest_Top is -- this is the top
- Port (
- DataxD : inout std_logic_vector(15 downto 0);
- AddrxDI : in std_logic_vector(12 downto 0);
- CSxBI : in std_logic;
- WRxBI : in std_logic;
- RDxBI : in std_logic;
- ClkxCI : in std_logic
- --ResetxRB : in std_logic
- );
-end BRAMTest_Top;
-
-
-
-architecture hierarchical of BRAMTest_Top is
- signal DataOutRAMxD : std_logic_vector(15 downto 0);
- signal CSBRAM : std_logic := '0';
- signal WRBRAM : std_logic := '0';
- signal CLKBRAM : std_logic := '0';
-
-begin
-
-
- -- RAMB16_S18: Virtex-II/II-Pro, Spartan-3 1k x 16 + 2 Parity bits Single-Port RAM
- -- Xilinx HDL Language Template version 6.3.1i
-
- RAMB16_S18_inst : RAMB16_S18
- generic map (
- INIT => X"00000", -- Value of output RAM registers at startup
- SRVAL => X"00000", -- Ouput value upon SSR assertion
- WRITE_MODE => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
- INIT_00 => X"cacaacac000000000000000000000000000000000000000000000000acaccaca",
- INIT_01 => X"cccc00000000000000000000000000000000000000000000000000000000aaaa",
- INIT_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_07 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_08 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_09 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0A => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0B => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0C => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0D => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0E => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_0F => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_10 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_11 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_12 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_13 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_14 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_15 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_16 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_17 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_18 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_19 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1A => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1B => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1C => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1D => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1E => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_1F => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_20 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_21 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_22 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_23 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_24 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_25 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_26 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_27 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_28 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_29 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2A => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2B => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2C => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2D => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2E => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_2F => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_30 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_31 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_32 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_33 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_34 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_35 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_36 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_37 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_38 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_39 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3A => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3B => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3C => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3D => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3E => X"0000000000000000000000000000000000000000000000000000000000000000",
- INIT_3F => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_00 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_01 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
- INITP_07 => X"0000000000000000000000000000000000000000000000000000000000000000")
- port map (
- DO => DataOutRAMxD, -- 16-bit Data Output
- DOP => open, -- 2-bit parity Output
- ADDR => AddrxDI(10 downto 1), -- 10-bit Address Input
- CLK => CLKBRAM, -- Clock
- DI => DataxD, -- 16-bit Data Input
- DIP => "00", -- 2-bit parity Input
- EN => CSBRAM , -- RAM Enable Input
- SSR => '0', -- Synchronous Set/Reset Input
- WE => WRBRAM -- Write Enable Input
- );
-
- OutputEnable: process (DataOutRAMxD, CSxBI, RDxBI)
- begin
- if (CSxBI = '0' and RDxBI = '0') then -- fix me
- DataxD <= DataOutRAMxD;
- else
- DataxD <= (others => 'Z'); --
- end if;
- end process OutputEnable;
-
- CSBRAM <= not CSxBI;
- WRBRAM <= not WRxBI;
- CLKBRAM <= ClkxCI;
--- End of RAMB16_S18_inst instantiation
-end hierarchical;
Deleted: trunk/firmware/BRAMTest/BRAMTest_APF.ucf
===================================================================
--- trunk/firmware/BRAMTest/BRAMTest_APF.ucf 2009-04-22 09:09:35 UTC (rev 1235)
+++ trunk/firmware/BRAMTest/BRAMTest_APF.ucf 2009-04-22 11:49:17 UTC (rev 1236)
@@ -1,40 +0,0 @@
-# Constraint file for BRAMTest
-NET "ClkxCI" TNM_NET = "ClkxCI";
-TIMESPEC "TS_ClkxCI" = PERIOD "ClkxCI" 10 ns HIGH 50 %;
-
-NET "DataxD<0>" LOC = "P1" ;
-NET "DataxD<1>" LOC = "P2" ;
-NET "DataxD<2>" LOC = "P4" ;
-NET "DataxD<3>" LOC = "P5" ;
-NET "DataxD<4>" LOC = "P6" ;
-NET "DataxD<5>" LOC = "P7" ;
-NET "DataxD<6>" LOC = "P8" ;
-NET "DataxD<7>" LOC = "P10" ;
-NET "DataxD<8>" LOC = "P11" ;
-NET "DataxD<9>" LOC = "P12" ;
-NET "DataxD<10>" LOC = "P13" ;
-NET "DataxD<11>" LOC = "P14" ;
-NET "DataxD<12>" LOC = "P15" ;
-NET "DataxD<13>" LOC = "P17" ;
-NET "DataxD<14>" LOC = "P18" ;
-NET "DataxD<15>" LOC = "P20" ;
-
-NET "AddrxDI<0>" LOC = "P21" ;
-NET "AddrxDI<1>" LOC = "P23" ;
-NET "AddrxDI<2>" LOC = "P24" ;
-NET "AddrxDI<3>" LOC = "P25" ;
-NET "AddrxDI<4>" LOC = "P26" ;
-NET "AddrxDI<5>" LOC = "P27" ;
-NET "AddrxDI<6>" LOC = "P28" ;
-NET "AddrxDI<7>" LOC = "P30" ;
-NET "AddrxDI<8>" LOC = "P31" ;
-NET "AddrxDI<9>" LOC = "P32" ;
-NET "AddrxDI<10>" LOC = "P33" ;
-NET "AddrxDI<11>" LOC = "P35" ;
-NET "AddrxDI<12>" LOC = "P36" ;
-
-NET "ClkxCI" LOC = "P55" ;
-NET "CSxBI" LOC = "P59" ;
-NET "WRxBI" LOC = "P60" ;
-NET "RDxBI" LOC = "P63" ;
-#end
Deleted: trunk/firmware/BRAMTest/BRAMtest.ise
===================================================================
(Binary files differ)
Added: trunk/firmware/BRAMTest/bin/BRAMTEST_APF27_200k.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/BRAMTest/bin/BRAMTEST_APF27_200k.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/BRAMTest/bin/BRAMTEST_APF9328_200k.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/BRAMTest/bin/BRAMTEST_APF9328_200k.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/firmware/BRAMTest/bramtest_top.bin
===================================================================
(Binary files differ)
Deleted: trunk/firmware/BRAMTest/bramtest_top_APF.bin
===================================================================
(Binary files differ)
Copied: trunk/firmware/BRAMTest/src/BRAMTest.vhdl (from rev 1233, trunk/firmware/BRAMTest/BRAMTest.vhdl)
===================================================================
--- trunk/firmware/BRAMTest/src/BRAMTest.vhdl (rev 0)
+++ trunk/firmware/BRAMTest/src/BRAMTest.vhdl 2009-04-22 11:49:17 UTC (rev 1236)
@@ -0,0 +1,156 @@
+----------------------------------------------------------------------------------
+-- Company: Armadeus Project
+-- Engineer: michael lerjen
+--
+-- Create Date: 22:04:02 04/12/2006
+-- Design Name:
+-- Module Name:
+-- Project Name:
+-- Target Devices:
+-- Tool versions:
+-- Description:
+--
+-- Dependencies:
+--
+-- Revision:
+-- Revision 0.02 - suppressing warning
+-- Revision 0.01 - File Created
+-- Additional Comments:
+--
+----------------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+library UNISIM;
+use UNISIM.VComponents.all;
+
+entity BRAMTest_Top is -- this is the top
+ Port (
+ DataxD : inout std_logic_vector(15 downto 0);
+ AddrxDI : in std_logic_vector(10 downto 1);
+ CSxBI : in std_logic;
+ WRxBI : in std_logic;
+ RDxBI : in std_logic;
+ ClkxCI : in std_logic
+ );
+end BRAMTest_Top;
+
+
+
+architecture hierarchical of BRAMTest_Top is
+ signal DataOutRAMxD : std_logic_vector(15 downto 0);
+ signal CSBRAM : std_logic := '0';
+ signal WRBRAM : std_logic := '0';
+ signal CLKBRAM : std_logic := '0';
+
+begin
+
+
+ -- RAMB16_S18: Virtex-II/II-Pro, Spartan-3 1k x 16 + 2 Parity bits Single-Port RAM
+ -- Xilinx HDL Language Template version 6.3.1i
+
+ RAMB16_S18_inst : RAMB16_S18
+ generic map (
+ INIT => X"00000", -- Value of output RAM registers at startup
+ SRVAL => X"00000", -- Ouput value upon SSR assertion
+ WRITE_MODE => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
+ INIT_00 => X"cacaacac000000000000000000000000000000000000000000000000acaccaca",
+ INIT_01 => X"cccc00000000000000000000000000000000000000000000000000000000aaaa",
+ INIT_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_07 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_08 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_09 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0A => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0B => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0C => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0D => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0E => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_0F => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_10 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_11 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_12 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_13 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_14 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_15 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_16 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_17 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_18 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_19 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1A => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1B => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1C => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1D => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1E => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_1F => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_20 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_21 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_22 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_23 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_24 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_25 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_26 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_27 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_28 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_29 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2A => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2B => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2C => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2D => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2E => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_2F => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_30 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_31 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_32 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_33 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_34 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_35 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_36 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_37 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_38 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_39 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3A => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3B => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3C => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3D => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3E => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INIT_3F => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_00 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_01 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_02 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_03 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_04 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_05 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_06 => X"0000000000000000000000000000000000000000000000000000000000000000",
+ INITP_07 => X"0000000000000000000000000000000000000000000000000000000000000000")
+ port map (
+ DO => DataOutRAMxD, -- 16-bit Data Output
+ DOP => open, -- 2-bit parity Output
+ ADDR => AddrxDI(10 downto 1), -- 10-bit Address Input
+ CLK => CLKBRAM, -- Clock
+ DI => DataxD, -- 16-bit Data Input
+ DIP => "00", -- 2-bit parity Input
+ EN => CSBRAM , -- RAM Enable Input
+ SSR => '0', -- Synchronous Set/Reset Input
+ WE => WRBRAM -- Write Enable Input
+ );
+
+ OutputEnable: process (DataOutRAMxD, CSxBI, RDxBI)
+ begin
+ if (CSxBI = '0' and RDxBI = '0') then -- fix me
+ DataxD <= DataOutRAMxD;
+ else
+ DataxD <= (others => 'Z'); --
+ end if;
+ end process OutputEnable;
+
+ CSBRAM <= not CSxBI;
+ WRBRAM <= not WRxBI;
+ CLKBRAM <= ClkxCI;
+-- End of RAMB16_S18_inst instantiation
+end hierarchical;
Added: trunk/firmware/BRAMTest/src/BRAMTest_APF27.ucf
===================================================================
--- trunk/firmware/BRAMTest/src/BRAMTest_APF27.ucf (rev 0)
+++ trunk/firmware/BRAMTest/src/BRAMTest_APF27.ucf 2009-04-22 11:49:17 UTC (rev 1236)
@@ -0,0 +1,43 @@
+# Constraint file for BRAMTest
+NET "ClkxCI" TNM_NET = "ClkxCI";
+TIMESPEC "TS_ClkxCI" = PERIOD "ClkxCI" 10 ns HIGH 50 %;
+NET "ClkxCI" LOC="N9" | IOSTANDARD=LVCMOS18;# CLK0
+
+# data bus
+NET "DataxD<0>" LOC="T5" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA0
+NET "DataxD<1>" LOC="T6" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA1
+NET "DataxD<2>" LOC="P7" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA2
+NET "DataxD<3>" LOC="N8" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA3
+NET "DataxD<4>" LOC="P12"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA4
+NET "DataxD<5>" LOC="T13"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA5
+NET "DataxD<6>" LOC="R13"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA6
+NET "DataxD<7>" LOC="T14"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA7
+NET "DataxD<8>" LOC="P5" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA8
+NET "DataxD<9>" LOC="N6" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA9
+NET "DataxD<10>" LOC="T3" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA10
+NET "DataxD<11>" LOC="T11"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA11
+NET "DataxD<12>" LOC="T4" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA12
+NET "DataxD<13>" LOC="R5" | DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA13
+NET "DataxD<14>" LOC="M10"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA14
+NET "DataxD<15>" LOC="T10"| DRIVE=8 | IOSTANDARD=LVCMOS18; # DATA15
+
+# address bus
+NET "AddrxDI<1>" LOC="N5" | IOSTANDARD=LVCMOS18; # ADDR1
+NET "AddrxDI<2>" LOC="L7" | IOSTANDARD=LVCMOS18; # ADDR2
+NET "AddrxDI<3>" LOC="M7" | IOSTANDARD=LVCMOS18; # ADDR3
+NET "AddrxDI<4>" LOC="M8" | IOSTANDARD=LVCMOS18; # ADDR4
+NET "AddrxDI<5>" LOC="L8" | IOSTANDARD=LVCMOS18; # ADDR5
+NET "AddrxDI<6>" LOC="L9" | IOSTANDARD=LVCMOS18; # ADDR6
+NET "AddrxDI<7>" LOC="L10"| IOSTANDARD=LVCMOS18; # ADDR7
+NET "AddrxDI<8>" LOC="M11"| IOSTANDARD=LVCMOS18; # ADDR8
+NET "AddrxDI<9>" LOC="P11"| IOSTANDARD=LVCMOS18; # ADDR9
+NET "AddrxDI<10>" LOC="N11"| IOSTANDARD=LVCMOS18; # ADDR10
+# not used for BRAMTest
+#NET "AddrxDI<11>" LOC="N12"| IOSTANDARD=LVCMOS18; # ADDR11
+#NET "AddrxDI<12>" LOC="P13"| IOSTANDARD=LVCMOS18; # ADDR12
+
+# controls signals
+NET "CSxBI" LOC="P10"| IOSTANDARD=LVCMOS18; # CS5N
+NET "WRxBI" LOC="P9" | IOSTANDARD=LVCMOS18; # EB0N
+NET "RDxBI" LOC="R9" | IOSTANDARD=LVCMOS18; # OEN
+#end
Added: trunk/firmware/BRAMTest/src/BRAMTest_APF9328.ucf
===================================================================
--- trunk/firmware/BRAMTest/src/BRAMTest_APF9328.ucf (rev 0)
+++ trunk/firmware/BRAMTest/src/BRAMTest_APF9328.ucf 2009-04-22 11:49:17 UTC (rev 1236)
@@ -0,0 +1,44 @@
+# Clock
+NET "ClkxCI" TNM_NET = "ClkxCI";
+TIMESPEC "TS_ClkxCI" = PERIOD "ClkxCI" 10 ns HIGH 50 %;
+NET "ClkxCI" LOC = "P55" ;
+
+#address bus
+NET "AddrxDI<1>" LOC = "P23" ;
+NET "AddrxDI<2>" LOC = "P24" ;
+NET "AddrxDI<3>" LOC = "P25" ;
+NET "AddrxDI<4>" LOC = "P26" ;
+NET "AddrxDI<5>" LOC = "P27" ;
+NET "AddrxDI<6>" LOC = "P28" ;
+NET "AddrxDI<7>" LOC = "P30" ;
+NET "AddrxDI<8>" LOC = "P31" ;
+NET "AddrxDI<9>" LOC = "P32" ;
+NET "AddrxDI<10>" LOC = "P33";
+# not used for BRAMTest
+#NET "AddrxDI<0>" LOC = "P21";
+#NET "AddrxDI<11>" LOC = "P35";
+#NET "AddrxDI<12>" LOC = "P36";
+
+# data bus
+NET "DataxD<0>" LOC = "P1" ;
+NET "DataxD<1>" LOC = "P2" ;
+NET "DataxD<2>" LOC = "P4" ;
+NET "DataxD<3>" LOC = "P5" ;
+NET "DataxD<4>" LOC = "P6" ;
+NET "DataxD<5>" LOC = "P7" ;
+NET "DataxD<6>" LOC = "P8" ;
+NET "DataxD<7>" LOC = "P10" ;
+NET "DataxD<8>" LOC = "P11" ;
+NET "DataxD<9>" LOC = "P12" ;
+NET "DataxD<10>" LOC = "P13" ;
+NET "DataxD<11>" LOC = "P14" ;
+NET "DataxD<12>" LOC = "P15" ;
+NET "DataxD<13>" LOC = "P17" ;
+NET "DataxD<14>" LOC = "P18" ;
+NET "DataxD<15>" LOC = "P20" ;
+
+# controls signals
+NET "CSxBI" LOC = "P59" ;
+NET "WRxBI" LOC = "P60" ;
+NET "RDxBI" LOC = "P63" ;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-04-22 09:09:42
|
Revision: 1235
http://armadeus.svn.sourceforge.net/armadeus/?rev=1235&view=rev
Author: FabM
Date: 2009-04-22 09:09:35 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
[FIRMWARE] beautify wisbone_example VHDL code
Modified Paths:
--------------
trunk/firmware/wishbone_example/src/button.vhd
trunk/firmware/wishbone_example/src/intercon.vhd
trunk/firmware/wishbone_example/src/led.vhd
Modified: trunk/firmware/wishbone_example/src/button.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/button.vhd 2009-04-21 08:27:09 UTC (rev 1234)
+++ trunk/firmware/wishbone_example/src/button.vhd 2009-04-22 09:09:35 UTC (rev 1235)
@@ -41,7 +41,11 @@
---------------------------------------------------------------------------
Architecture button_1 of button is
- ---------------------------------------------------------------------------
+---------------------------------------------------------------------------
+ -- registers mapping
+ constant REG_ID : std_logic := '0';
+ constant REG_BUTTON : std_logic := '1';
+
signal button_r : std_logic ;
signal reg : std_logic_vector( 15 downto 0);
begin
@@ -56,7 +60,6 @@
end if;
end process cbutton;
-
-- rise interruption
pbutton : process(gls_clk,gls_reset)
begin
@@ -80,16 +83,16 @@
wbs_ack <= '0';
wbs_readdata <= (others => '0');
elsif(rising_edge(gls_clk)) then
- wbs_ack <= '0';
if(wbs_strobe = '1' and wbs_write = '0' and wbs_cycle = '1')then
wbs_ack <= '1';
- if wbs_add = '0' then
+ if wbs_add = REG_ID then
wbs_readdata <= std_logic_vector(to_unsigned(id,16));
else
wbs_readdata <= reg;
end if;
else
wbs_readdata <= (others => '0');
+ wbs_ack <= '0';
end if;
end if;
end process pread;
Modified: trunk/firmware/wishbone_example/src/intercon.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/intercon.vhd 2009-04-21 08:27:09 UTC (rev 1234)
+++ trunk/firmware/wishbone_example/src/intercon.vhd 2009-04-22 09:09:35 UTC (rev 1235)
@@ -101,7 +101,7 @@
led0_wbs_add <= wrapper_wbm_address(1);
button0_wbs_add <= wrapper_wbm_address(1);
- decodeproc : process(rstgen_syscon00_gls_clk,rstgen_syscon00_gls_reset,wrapper_wbm_address)
+ decodeproc : process(rstgen_syscon00_gls_clk,rstgen_syscon00_gls_reset)
begin
if rstgen_syscon00_gls_reset='1' then
irq_mngr00_swb16_cs <= '0';
Modified: trunk/firmware/wishbone_example/src/led.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/led.vhd 2009-04-21 08:27:09 UTC (rev 1234)
+++ trunk/firmware/wishbone_example/src/led.vhd 2009-04-22 09:09:35 UTC (rev 1235)
@@ -42,24 +42,32 @@
-----------------------------------------------------------------------
Architecture led_1 of led is
-----------------------------------------------------------------------
+ -- registers mapping
+ constant REG_LED : std_logic := '0';
+ constant REG_ID : std_logic := '1';
+
signal reg : std_logic_vector( wb_size-1 downto 0);
+ signal read_ack : std_logic ;
+ signal write_ack : std_logic ;
begin
-- connect led_o
led_o <= reg(0);
-wbs_ack <= wbs_strobe;
+wbs_ack <= read_ack or write_ack;
-- manage register
write_bloc : process(gls_clk,gls_reset)
begin
if gls_reset = '1' then
reg <= (others => '0');
+ write_ack <= '0';
elsif rising_edge(gls_clk) then
if ((wbs_strobe and wbs_write and wbs_cycle) = '1' ) then
reg <= wbs_writedata;
+ write_ack <= '1';
else
- reg <= reg;
+ write_ack <= '0';
end if;
end if;
@@ -71,13 +79,15 @@
wbs_readdata <= (others => '0');
elsif rising_edge(gls_clk) then
if (wbs_strobe = '1' and wbs_write = '0' and wbs_cycle = '1' ) then
- if wbs_add = '0' then
+ read_ack <= '1';
+ if wbs_add = REG_LED then
wbs_readdata <= reg;
else
wbs_readdata <= std_logic_vector(to_unsigned(id,wb_size));
end if;
else
wbs_readdata <= (others => '0');
+ read_ack <= '0';
end if;
end if;
end process read_bloc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-21 08:27:18
|
Revision: 1234
http://armadeus.svn.sourceforge.net/armadeus/?rev=1234&view=rev
Author: artemys
Date: 2009-04-21 08:27:09 +0000 (Tue, 21 Apr 2009)
Log Message:
-----------
[DEMOS] Makes backlight control tool works again
Modified Paths:
--------------
trunk/target/demos/backlight_control/Makefile
trunk/target/demos/backlight_control/backlight_sysctl.c
Modified: trunk/target/demos/backlight_control/Makefile
===================================================================
--- trunk/target/demos/backlight_control/Makefile 2009-04-18 15:18:40 UTC (rev 1233)
+++ trunk/target/demos/backlight_control/Makefile 2009-04-21 08:27:09 UTC (rev 1234)
@@ -1,23 +1,18 @@
+ARMADEUS_BASE_DIR=../../..
+include $(ARMADEUS_BASE_DIR)/Makefile.in
ifeq ($(TARGET),)
- BUILDROOT_DIR:=../../../buildroot/
- BUILD_DIR_EXT:=$(shell ls $(BUILDROOT_DIR) | grep -e "^build_arm*")
- BUILD_DIR:=$(BUILDROOT_DIR)/$(BUILD_DIR_EXT)
-
- SDL_DIR:=$(BUILD_DIR)/SDL-1.2.11/
- STAGING_DIR:=$(BUILD_DIR)/staging_dir/
- ROOT_DIR:=$(BUILDROOT_DIR)/project_$(BUILD_DIR_EXT)/armadeus/root/
-
- CC:=$(STAGING_DIR)/bin/arm-linux-gcc
- DEFINES="TARGET"
- CFLAGS:=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --cflags)
- LIBS:=$(shell STAGING_DIR=$(STAGING_DIR) sh $(SDL_DIR)/sdl-config --libs)
+ ROOT_DIR:=$(ARMADEUS_ROOTFS_DIR)
+ CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+ DEFINES="-DTARGET"
+ CFLAGS:=$(shell STAGING_DIR=$(ARMADEUS_STAGING_DIR) sh $(ARMADEUS_SDL_DIR)/sdl-config --cflags)
+ LIBS:=$(shell STAGING_DIR=$(ARMADEUS_STAGING_DIR) sh $(ARMADEUS_SDL_DIR)/sdl-config --libs) -lSDL_image
else
- ROOT_DIR:="/"
- CFLAGS=`/usr/bin/sdl-config --cflags`
- LIBS=`/usr/bin/sdl-config --libs`
- CC=gcc
- DEFINES="HOST"
+ ROOT_DIR:="/"
+ CFLAGS=`/usr/bin/sdl-config --cflags`
+ LIBS=`/usr/bin/sdl-config --libs` -lSDL_Image
+ CC=gcc
+ DEFINES="-DHOST"
endif
INSTALL_DIR:=$(ROOT_DIR)/usr/bin/
@@ -34,7 +29,7 @@
$(CC) $(CFLAGS) -c -o $@ $^
backlight_sysctl.o: backlight_sysctl.c
- $(CC) $(CFLAGS) -D$(DEFINES) -c -o $@ $^
+ $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $^
backlight: backlight.o backlight_sysctl.o
$(CC) $(LIBS) -o $@ $^
Modified: trunk/target/demos/backlight_control/backlight_sysctl.c
===================================================================
--- trunk/target/demos/backlight_control/backlight_sysctl.c 2009-04-18 15:18:40 UTC (rev 1233)
+++ trunk/target/demos/backlight_control/backlight_sysctl.c 2009-04-21 08:27:09 UTC (rev 1234)
@@ -10,8 +10,8 @@
int max_brightness = 255;
#ifdef TARGET
-#define BRIGHTNESS_SYS_FILE "/sys/class/backlight/imxl-bl/brightness"
-#define MAX_BRIGHTNESS_SYS_FILE "/sys/class/backlight/imxl-bl/max_brightness"
+#define BRIGHTNESS_SYS_FILE "/sys/class/backlight/imx-bl/brightness"
+#define MAX_BRIGHTNESS_SYS_FILE "/sys/class/backlight/imx-bl/max_brightness"
#else
#define BRIGHTNESS_SYS_FILE "./backlight.dat"
#define MAX_BRIGHTNESS_SYS_FILE "./backlight.dat"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-04-18 15:18:55
|
Revision: 1233
http://armadeus.svn.sourceforge.net/armadeus/?rev=1233&view=rev
Author: thom25
Date: 2009-04-18 15:18:40 +0000 (Sat, 18 Apr 2009)
Log Message:
-----------
[LINUX] make apf27 audio playback working with the pwm
Modified Paths:
--------------
trunk/target/linux/modules/pwm/pwm.c
Modified: trunk/target/linux/modules/pwm/pwm.c
===================================================================
--- trunk/target/linux/modules/pwm/pwm.c 2009-04-16 16:39:38 UTC (rev 1232)
+++ trunk/target/linux/modules/pwm/pwm.c 2009-04-18 15:18:40 UTC (rev 1233)
@@ -70,8 +70,10 @@
#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
@@ -80,6 +82,10 @@
#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 */
+
#else
#define PWMCTRL (0x00)
#define PWMSTATUS (0x00)
@@ -93,6 +99,8 @@
#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
@@ -104,6 +112,10 @@
#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 */
+
#endif
#define DRIVER_NAME "imx-pwm"
@@ -200,8 +212,47 @@
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)
+ return 32768;
+#ifdef CONFIG_ARCH_MX2
+ return clk_get_rate(pwm->clk);
+#else
+ return 16000000;
+#endif
+}
+/* result in Hz */
+static long get_pwm_min_freq(struct pwm_device *pwm)
+{
+ return PWM_MIN_FREQUENCY;
+}
+/* result in Hz */
+static long get_pwm_max_freq(struct pwm_device *pwm)
+{
+ return PWM_MAX_FREQUENCY;
+}
+
+/* freq in Hz */
+static void compute_pwm_params(u32 req_freq, struct pwm_device *pwm)
+{
+ u32 input_freq, divider;
+ input_freq = get_current_pwm_clk_rate(pwm);
+ 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;
+ }
+ else{
+ pwm->entry.period = divider-2;
+ pwm->entry.prescaler = 1;
+ }
+}
+
+
+
/****************************************************************
*
***************************************************************/
@@ -216,7 +267,21 @@
writel(temp | (bit&mask), reg);
}
+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),
+ PWM_PRESCALER_MASK, pwm->membase + PWMCTRL ); /*| PWMC_REPEAT(3)*/;
+ /* Setup period */
+ writel(PWM_PERIOD(pwm->entry.period) , pwm->membase + PWMPERIOD );
+ /* Setup duty cycle */
+ writel(PWM_SAMPLE( (u32) ((pwm->entry.period * pwm->duty) / 1000) ),
+ pwm->membase + PWMSAMPLE);
+}
+
/**
* setup_pwm_unit - common setup function whenever something was changed
* @pwm: PWM unit to work with
@@ -226,16 +291,7 @@
if (pwm->active) {
/* Activate PWM */
write_bits( PWM_EN, PWM_EN, 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)*/;
- /* Setup period */
- writel(PWM_PERIOD(pwm->entry.period) , pwm->membase + PWMPERIOD );
- /* Setup duty cycle */
- writel(PWM_SAMPLE( (u32) ((pwm->entry.period * pwm->duty) / 1000) ),
- pwm->membase + PWMSAMPLE);
+ setup_pwm_params(pwm);
} else {
/* De-activate */
write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
@@ -322,9 +378,6 @@
write_bits( PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
- /* Enable interrupt */
- //PWMC |= PWMC_IRQEN;
-
return 1;
}
@@ -336,7 +389,12 @@
// wait unit gWriteCnt == 0
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_EN, PWM_EN, pwm->membase + PWMCTRL );
+
if( pwm->circ_buf.buf ) {
kfree( pwm->circ_buf.buf );
pwm->circ_buf.buf = 0;
@@ -349,7 +407,9 @@
{
struct pwm_device *pwm = dev_table[iminor(inode)];
+ pwm->circ_buf.buf = 0;
pwm->dataLen = PWM_DATA_8BIT;
+ pwm->nbbytes = 0;
/* Init PWM hardware */
init_pwm(pwm);
@@ -403,35 +463,38 @@
/* Set Playback frequency/ouput rate */
case PWM_IOC_SFREQ:
{
+ int clock = get_current_pwm_clk_rate(pwm);
/* Disable PWM */
write_bits( ~PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
- /* Select 16MHz PERCLK1 as CLK source */
+
+ 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 );
- /* PRESCALER = 0 => use full IPG */
- write_bits( 0, PWM_PRESCALER_MASK, pwm->membase + PWMCTRL );
- /* CLKSEL = 0 => divide by 2 */
- write_bits( 0, PWM_CLKSEL_MASK, pwm->membase + PWMCTRL );
-
+#ifdef CONFIG_ARCH_MX2
+ write_bits( PWM_PRESCALER(2),PWM_PRESCALER_MASK, pwm->membase + PWMCTRL );
+#else
+ write_bits( PWM_PRESCALER(1),PWM_PRESCALER_MASK, pwm->membase + PWMCTRL );
+#endif
switch(arg)
{
case PWM_SAMPLING_32KHZ:
/* REPEAT = 0 => divide by 1 */
write_bits( 0, PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
- /* 16MHz/256/1/2 = 32768 */
str = "32Khz";
break;
case PWM_SAMPLING_16KHZ:
/* REPEAT = 01 => divide by 2 */
write_bits( PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
- /* 16MHz/256/2/2 = 16384 */
str = "16Khz";
break;
case PWM_SAMPLING_8KHZ:
default:
/* REPEAT = 10 => divide by 4*/
- write_bits( PWM_REPEAT(1), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
- /* 16MHz/256/4/2 = 8192 */
+ write_bits( PWM_REPEAT(2), PWM_REPEAT_MASK, pwm->membase + PWMCTRL );
str = "8Khz";
break;
}
@@ -515,7 +578,6 @@
int remaining_space = 0;
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" );
@@ -523,7 +585,7 @@
count = MAX_SOUND_BUFFER_SIZE;
/* First time, allocate the double buffer */
if (!circ->buf) {
- circ->buf = kmalloc( count*2, GFP_KERNEL );
+ circ->buf = kmalloc( MAX_SOUND_BUFFER_SIZE*2, GFP_KERNEL );
if (!circ->buf) {
goto out;
} else {
@@ -533,6 +595,7 @@
circ->size = MAX_SOUND_BUFFER_SIZE*2;
}
}
+ pr_debug("write %x, %x, %x\n", readl(pwm->membase + PWMCTRL), readl(pwm->membase + PWMIRQ), readl(pwm->membase + PWMSTATUS));
/* If there is enough space at the end of the buffer for all data in one copy, do it */
remaining_space = circ->size - circ->write;
@@ -556,21 +619,21 @@
increase_circbuf(&pwm->circ_buf, count - remaining_space);
}
- /* Enable PWM */
- write_bits( PWM_EN, PWM_EN, pwm->membase + PWMCTRL );
- writel(0x00000000, pwm->membase + PWMSAMPLE);
-
if (pwm->mode == PWM_PLAY_MODE) {
/* Enable IRQ */
- write_bits( PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMCTRL);
+ write_bits( PWM_IRQEN, PWM_IRQEN, pwm->membase + PWMIRQ);
} else {
writel(pwm->sampleValue, pwm->membase + PWMSAMPLE);
- /* set prescaler to 128 */
- write_bits(0x7f00 , PWM_PRESCALER_MASK, pwm->membase + PWMCTRL);
+ /* set prescaler to the max */
+ 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 );
+ /* Enable PWM */
+ 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);
@@ -596,53 +659,7 @@
/////////////////////////////////////// END OF /DEV INTERFACE /////////////////////////////////////////////////////////
-#ifdef CONFIG_ARCH_MX2
-#define PWM_MIN_FREQUENCY 1 // Hz
-#define PWM_MAX_FREQUENCY 1000000 /* Hz */
-#else
-#define PWM_MIN_FREQUENCY 2 /* Hz */
-#define PWM_MAX_FREQUENCY 1000000 /* Hz */
-#endif
-static int get_current_pwm_clk_rate(struct pwm_device *pwm)
-{
- if( (readl(pwm->membase + PWMCTRL) & PWM_CLKSRC_MASK) == PWM_CLKSRC_32K)
- return 32768;
-#ifdef CONFIG_ARCH_MX2
- return clk_get_rate(pwm->clk);
-#else
- return 8000000;
-#endif
-}
-
-/* result in Hz */
-static long get_pwm_min_freq(struct pwm_device *pwm)
-{
- return PWM_MIN_FREQUENCY;
-}
-
-/* result in Hz */
-static long get_pwm_max_freq(struct pwm_device *pwm)
-{
- return PWM_MAX_FREQUENCY;
-}
-
-/* freq in Hz */
-static void compute_pwm_params(u32 req_freq, struct pwm_device *pwm)
-{
- u32 input_freq, divider;
- input_freq = get_current_pwm_clk_rate(pwm);
- 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;
- }
- else{
- pwm->entry.period = divider-2;
- pwm->entry.prescaler = 1;
- }
-}
-
/**
* pwm_show_duty - return current duty setting
* @dev: device to work with
@@ -879,10 +896,15 @@
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);
+ }
+#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);
- pwm->nbbytes++;
}
+#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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-04-16 16:39:41
|
Revision: 1232
http://armadeus.svn.sourceforge.net/armadeus/?rev=1232&view=rev
Author: artemys
Date: 2009-04-16 16:39:38 +0000 (Thu, 16 Apr 2009)
Log Message:
-----------
[BUILDROOT] Add wirelesstools in default APF27 Buildroot config
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig 2009-04-16 16:35:29 UTC (rev 1231)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig 2009-04-16 16:39:38 UTC (rev 1232)
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Wed Mar 11 17:06:45 2009
+# Thu Apr 16 18:36:27 2009
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
@@ -453,7 +453,7 @@
# BR2_PACKAGE_VSFTPD is not set
# BR2_PACKAGE_VTUN is not set
# BR2_PACKAGE_WEBIF is not set
-# BR2_PACKAGE_WIRELESS_TOOLS is not set
+BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_BLOCKDEV_SUPPORT=y
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
BR2_PACKAGE_AD9889CTRL=y
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|