Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 409 → Rev 410

/programy/C/avr32/SFR08/SFR08.cpp
0,0 → 1,129
/*****************************************************************************/
/*
* Zmena I2C adresy
*
* Copyright (C) 2007 KAKL, KAKLIK
*
* 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.
*
*/
/*****************************************************************************/
 
#include <iostream>
#include <getopt.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "linux/i2c-dev.h"
#include "linux/i2c.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
 
using namespace std;
 
 
#define BC_Addr 0x0B
 
int file;
 
void I2C_addr (int Addr)
{
if (ioctl(file, I2C_SLAVE, Addr) == -1)
{
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr);
exit(-5);
}
}
 
 
unsigned int echo(int Addr) // precte vzdalenost z US cidla
{
char Buf[3];
 
I2C_addr(Addr);
Buf[0]=0x0;
Buf[1]=0x51;
write(file, Buf, 2);
usleep(80000);
read(file, Buf, 3);
return (Buf[1]*256+Buf[2]);
}
 
int i2c_init() // zinicializuje i2c
{
file = open("/dev/i2c-0", O_RDWR);
if (file < 0)
{
cerr << "Could not open /dev/i2c-0." << endl;
return -1;
}
return 0;
}
 
int main(int argc, char *argv[], char *envp[])
{
unsigned int OldAddress, NewAddress;
char Buf[10];
 
fprintf(stdout, "\n **** Change I2C Address **** \n \r");
 
if (argc<2)
{
printf("Use:\n%s OldAddress NewAddress - for change address\nOR\n%s Address - for echo\n\n\r",argv[0],argv[0]);
return 0;
}
 
i2c_init();
 
sscanf(argv[1],"%x",&OldAddress);
 
if (argc==2)
{
printf("Vzdalenost: %d\n", echo(OldAddress>>1));
close(file);
return 0;
}
 
sscanf(argv[2],"%x",&NewAddress);
 
printf("Old: %x New: %x\n", OldAddress, NewAddress);
 
printf("Vzdalenost: %d\n", echo(OldAddress>>1));
 
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xA0;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xAA;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xA5;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=NewAddress;
write(file, Buf, 2);
 
 
usleep(100000);
 
printf("Vzdalenost: %d\n", echo(NewAddress>>1));
 
close(file);
return 0;
}
/programy/C/avr32/cmps03/compass.c
0,0 → 1,140
/* compass.c
*
* Software to read from the CMPS03 magnetic compass.
*
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
 
/* Note that the documentation for the compass states its address as 0xC0.
* However, this includes the low bit which specifies read or write.
* Linux i2c does not include this bit in this address, so the actual
* address is 0xC0 shifted down, 0x60.
*/
 
#define CMPS_Addr (0xC0>>1)
#define I2C_SLAVE 0x0B /* Change slave address
 
/* The important registers on the compass. Internal/test registers omitted. */
#define CMPS03_SOFTWARE_REVISION 0x0
#define CMPS03_BEARING_BYTE 0x1
#define CMPS03_BEARING_WORD_HIGH 0x2
#define CMPS03_BEARING_WORD_LOW 0x3
#define CMPS03_CALIBRATE_CMD 0xF
 
void I2C_addr (int Addr) // vybere adresu cidla se kterym se bude komunikovat
{
if (ioctl(file, I2C_SLAVE, Addr) == -1)
{
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr);
exit(-5);
}
}
 
int i2c_init() // zinicializuje i2c
{
file = open("/dev/i2c-0", O_RDWR);
if (file < 0)
{
cerr << "Could not open /dev/i2c-0." << endl;
return -1;
}
return 0;
}
 
unsigned char read_azimut_mag() // precte azimut z kompasu
{
char Buf[3]; // promena pro manipulaci s i2c
 
I2C_addr(CMPS_Addr);
Buf[0]=1;
write(file,Buf,1);
read(file, Buf,1);
return (Buf[0]-SEVER);
}
 
void calib() // kalibrace kompasu
{
char Buf[3]; // promena pro manipulaci s i2c
 
I2C_addr(CMPS_Addr);
Buf[0]=15;
Buf[1]=0xFF;
write(file,Buf,2);
}
 
int main(int argc, char *argv[])
{
char *end;
int res,file;
int error;
char filename[20] ;
long funcs;
int heading_byte, heading_word_h, heading_word_l;
int bearing_long, bearing_degrees;
sprintf(filename,"/dev/i2c-0");
file = open(filename,O_RDWR);
if (errno != 0)
{
switch (errno)
{
case EACCES:
fprintf(stderr,"Run as root? \n");
break;
default:
fprintf(stderr,"Error: Could not open file '%s' : %s \n", filename, strerror(errno));
break;
}
}
if (ioctl(file,I2C_SLAVE,CMPS03_ADDR) < 0) {
switch (errno)
{
case EBUSY:
printf("device is busy \n");
break;
 
default:
printf("Got error: %s \n", strerror(errno));
exit(0);
}
}
/* Get software revision number */
res = read(file, CMPS03_SOFTWARE_REVISION,1);
if (res < 0) {
printf("Cannot read software revision level \n");
} else {
printf("Software revision level: %02x \n", res);
}
/* Loop and read from the compass. */
while (1) {
/* The heading byte is 0-255 for the 360 degrees. */
heading_byte = read(file, CMPS03_BEARING_BYTE,1);
if (heading_byte < 0) { printf("Error reading from compass. \n"); exit(1);}
/* The high resolution heading is given in two registers, and is 10 * the
* heading in degrees, ie 359.9 degrees reads as 3599. */
heading_word_h = read(file, CMPS03_BEARING_WORD_HIGH,1);
if (heading_word_h < 0) { printf("Error reading from compass. \n"); exit(1);}
heading_word_l = read(file, CMPS03_BEARING_WORD_LOW,1);
if (heading_word_l < 0) { printf("Error reading from compass. \n"); exit(1);}
/* Combine the two bytes, and get the heading in degrees. */
bearing_long = heading_word_h * 256 + heading_word_l;
bearing_degrees = bearing_long / 10;
printf("Bearing: %d \n", bearing_degrees);
/* Wait for a while. */
usleep(200000);
}
}
/programy/C/avr32/cmps03/main.cpp
0,0 → 1,155
/*****************************************************************************/
/*
* Zmena I2C adresy
*
* Copyright (C) 2007 KAKL
*
* 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.
*
*/
/*****************************************************************************/
 
#include <iostream>
#include <getopt.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "linux/i2c-dev.h"
#include "linux/i2c.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
 
using namespace std;
 
 
#define BC_Addr 0x0B
#define US3_Addr 0x70 // 0xE0 in fact; Sonar na doprovod
#define CMPS_Addr 0x60 // 0xC0
#define M1 0x50 // 0xA0 in fact
#define M2 0x51 // 0xA2 in fact
 
 
int file;
 
void I2C_addr (int Addr)
{
if (ioctl(file, I2C_SLAVE, Addr) == -1)
{
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr);
exit(-5);
}
}
 
 
unsigned int echo(int Addr) // precte vzdalenost z US cidla
{
char Buf[3];
 
I2C_addr(Addr);
Buf[0]=0x0;
Buf[1]=0x51;
write(file, Buf, 2);
usleep(80000);
read(file, Buf, 3);
return (Buf[1]*256+Buf[2]);
}
 
unsigned char read_azimut_mag() // precte azimut z kompasu
{
char Buf[3]; // promena pro manipulaci s i2c
 
I2C_addr(CMPS_Addr);
Buf[0]=1;
write(file,Buf,1);
read(file, Buf,1);
return Buf[0];
}
 
void calib() // kalibrace kompasu
{
char Buf[3]; // promena pro manipulaci s i2c
 
I2C_addr(CMPS_Addr);
Buf[0]=15;
Buf[1]=0xFF;
write(file,Buf,2);
}
 
int i2c_init() // zinicializuje i2c
{
file = open("/dev/i2c-0", O_RDWR);
if (file < 0)
{
cerr << "Could not open /dev/i2c-0." << endl;
return -1;
}
return 0;
}
 
int main(int argc, char *argv[], char *envp[])
{
unsigned int OldAddress, NewAddress;
char Buf[10];
 
fprintf(stdout, "\n **** Change I2C Address **** \n \r");
 
if (argc<2)
{
printf("Use:\n%s OldAddress NewAddress - for change address\nOR\n%s Address - for echo\n\n\r",argv[0],argv[0]);
return 0;
}
 
i2c_init();
 
sscanf(argv[1],"%x",&OldAddress);
 
if (argc==2)
{
printf("Vzdalenost: %d\n", echo(OldAddress>>1));
close(file);
return 0;
}
 
sscanf(argv[2],"%x",&NewAddress);
 
printf("Old: %x New: %x\n", OldAddress, NewAddress);
 
printf("Vzdalenost: %d\n", echo(OldAddress>>1));
 
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xA0;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xAA;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=0xA5;
write(file, Buf, 2);
I2C_addr(OldAddress>>1);
Buf[0]=0x0;
Buf[1]=NewAddress;
write(file, Buf, 2);
 
 
usleep(100000);
 
printf("Vzdalenost: %d\n", echo(NewAddress>>1));
 
close(file);
return 0;
}
/programy/C/avr32/linux-kernel/rootfs/uImage
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/build
0,0 → 1,0
link /home/kaklik/projekty/programy/Atmel32_C/linux-kernel
Property changes:
Added: svn:special
+*
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/arc4.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/ecb.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/pcbc.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/loop.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/nbd.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/rd.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/bsd_comp.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_async.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_deflate.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_mppe.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppoe.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/tun.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/spi/spidev.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_ether.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_file_storage.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_serial.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_zero.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/gadgetfs.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/cifs/cifs.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fuse/fuse.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/msdos/msdos.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/smbfs/smbfs.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/vfat/vfat.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/avr32/snd-atmel-ac97.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.alias
0,0 → 1,13
# Aliases extracted from modules themselves.
alias block-major-7-* loop
alias block-major-1-* rd
alias net-pf-24 pppoe
alias ppp-compress-18 ppp_mppe
alias ppp-compress-21 bsd_comp
alias char-major-10-200 tun
alias tty-ldisc-3 ppp_async
alias ppp-compress-24 ppp_deflate
alias ppp-compress-26 ppp_deflate
alias /dev/ppp ppp_generic
alias char-major-108-* ppp_generic
alias char-major-10-229 fuse
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ccwmap
0,0 → 1,0
# ccw module match_flags cu_type cu_model dev_type dev_model
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.dep
0,0 → 1,31
/lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/pcbc.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/arc4.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/ecb.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/nbd.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/loop.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/rd.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_ether.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/gadgetfs.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_file_storage.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_zero.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_serial.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/spi/spidev.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppoe.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_mppe.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/bsd_comp.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/tun.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_async.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_deflate.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/avr32/snd-atmel-ac97.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/cifs/cifs.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/smbfs/smbfs.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fuse/fuse.ko:
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/msdos/msdos.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/vfat/vfat.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ieee1394map
0,0 → 1,0
# ieee1394 module match_flags vendor_id model_id specifier_id version
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.inputmap
0,0 → 1,0
# module matchBits bustype vendor product version evBits keyBits relBits absBits mscBits ledBits sndBits ffBits [swBits] driver_info
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.isapnpmap
0,0 → 1,0
# isapnp module cardvendor carddevice driver_data vendor function ...
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ofmap
0,0 → 1,0
# of module name type compatible
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.pcimap
0,0 → 1,0
# pci module vendor device subvendor subdevice class class_mask driver_data
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.seriomap
0,0 → 1,0
# serio module type extra id proto
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.symbols
0,0 → 1,57
# Aliases for symbols, used by symbol_request().
alias symbol:register_pppox_proto pppox
alias symbol:snd_ac97_pcm_open snd_ac97_codec
alias symbol:fat_sync_inode fat
alias symbol:fat_date_unix2dos fat
alias symbol:snd_ac97_pcm_assign snd_ac97_codec
alias symbol:unregister_pppox_proto pppox
alias symbol:snd_ac97_update snd_ac97_codec
alias symbol:loop_unregister_transfer loop
alias symbol:fat_dir_empty fat
alias symbol:snd_ac97_pcm_close snd_ac97_codec
alias symbol:snd_ac97_update_bits snd_ac97_codec
alias symbol:ppp_output_wakeup ppp_generic
alias symbol:slhc_remember slhc
alias symbol:fat_detach fat
alias symbol:crc_ccitt crc_ccitt
alias symbol:fat_notify_change fat
alias symbol:snd_ac97_set_rate snd_ac97_codec
alias symbol:snd_ac97_read snd_ac97_codec
alias symbol:crc_ccitt_table crc_ccitt
alias symbol:ppp_unregister_compressor ppp_generic
alias symbol:fat_build_inode fat
alias symbol:fat_attach fat
alias symbol:ppp_register_channel ppp_generic
alias symbol:fat_add_entries fat
alias symbol:ppp_channel_index ppp_generic
alias symbol:fat_free_clusters fat
alias symbol:slhc_compress slhc
alias symbol:snd_ac97_write_cache snd_ac97_codec
alias symbol:fat_get_dotdot_entry fat
alias symbol:ppp_input ppp_generic
alias symbol:slhc_toss slhc
alias symbol:slhc_init slhc
alias symbol:ppp_unregister_channel ppp_generic
alias symbol:fat_search_long fat
alias symbol:fat_alloc_new_dir fat
alias symbol:snd_ac97_pcm_double_rate_rules snd_ac97_codec
alias symbol:pppox_unbind_sock pppox
alias symbol:snd_ac97_mixer snd_ac97_codec
alias symbol:fat_fill_super fat
alias symbol:ac97_bus_type ac97_bus
alias symbol:slhc_free slhc
alias symbol:snd_ac97_bus snd_ac97_codec
alias symbol:fat_scan fat
alias symbol:ppp_unit_number ppp_generic
alias symbol:ppp_input_error ppp_generic
alias symbol:snd_ac97_get_short_name snd_ac97_codec
alias symbol:snd_ac97_write snd_ac97_codec
alias symbol:loop_register_transfer loop
alias symbol:pppox_ioctl pppox
alias symbol:fat_fs_panic fat
alias symbol:ppp_register_compressor ppp_generic
alias symbol:fat_remove_entries fat
alias symbol:slhc_uncompress slhc
alias symbol:snd_ac97_tune_hardware snd_ac97_codec
alias symbol:fat_flush_inodes fat
alias symbol:fat_getattr fat
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.usbmap
0,0 → 1,0
# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/source
0,0 → 1,0
link /home/kaklik/projekty/programy/Atmel32_C/linux-kernel
Property changes:
Added: svn:special
+*
\ No newline at end of property
/programy/C/avr32/linux-kernel/kernel/arch/avr32/boards/atngw100/setup.c
0,0 → 1,186
/*
* Board-specific setup code for the ATNGW100 Network Gateway
*
* Copyright (C) 2005-2006 Atmel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/clk.h>
#include <linux/etherdevice.h>
#include <linux/i2c-gpio.h>
#include <linux/init.h>
#include <linux/linkage.h>
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/leds.h>
#include <linux/spi/spi.h>
 
#include <asm/io.h>
#include <asm/setup.h>
 
#include <asm/arch/at32ap7000.h>
#include <asm/arch/board.h>
#include <asm/arch/init.h>
#include <asm/arch/portmux.h>
 
/* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata;
 
struct eth_addr {
u8 addr[6];
};
static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2];
 
static struct spi_board_info spi0_board_info[] __initdata = {
{
.modalias = "mtd_dataflash",
.max_speed_hz = 10000000,
.chip_select = 0,
},
};
 
static struct mci_platform_data __initdata mci0_data = {
.detect_pin = GPIO_PIN_PC(25),
.wp_pin = GPIO_PIN_PE(0),
};
 
/*
* The next two functions should go away as the boot loader is
* supposed to initialize the macb address registers with a valid
* ethernet address. But we need to keep it around for a while until
* we can be reasonably sure the boot loader does this.
*
* The phy_id is ignored as the driver will probe for it.
*/
static int __init parse_tag_ethernet(struct tag *tag)
{
int i;
 
i = tag->u.ethernet.mac_index;
if (i < ARRAY_SIZE(hw_addr))
memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address,
sizeof(hw_addr[i].addr));
 
return 0;
}
__tagtable(ATAG_ETHERNET, parse_tag_ethernet);
 
static void __init set_hw_addr(struct platform_device *pdev)
{
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
const u8 *addr;
void __iomem *regs;
struct clk *pclk;
 
if (!res)
return;
if (pdev->id >= ARRAY_SIZE(hw_addr))
return;
 
addr = hw_addr[pdev->id].addr;
if (!is_valid_ether_addr(addr))
return;
 
/*
* Since this is board-specific code, we'll cheat and use the
* physical address directly as we happen to know that it's
* the same as the virtual address.
*/
regs = (void __iomem __force *)res->start;
pclk = clk_get(&pdev->dev, "pclk");
if (!pclk)
return;
 
clk_enable(pclk);
__raw_writel((addr[3] << 24) | (addr[2] << 16)
| (addr[1] << 8) | addr[0], regs + 0x98);
__raw_writel((addr[5] << 8) | addr[4], regs + 0x9c);
clk_disable(pclk);
clk_put(pclk);
}
 
void __init setup_board(void)
{
at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
at32_map_usart(3, 1); /* USART 3: /dev/ttyS1 */
at32_setup_serial_console(0);
}
 
static const struct gpio_led ngw_leds[] = {
{ .name = "sys", .gpio = GPIO_PIN_PA(16), .active_low = 1,
.default_trigger = "heartbeat",
},
{ .name = "a", .gpio = GPIO_PIN_PA(19), .active_low = 1, },
{ .name = "b", .gpio = GPIO_PIN_PE(19), .active_low = 1, },
};
 
static const struct gpio_led_platform_data ngw_led_data = {
.num_leds = ARRAY_SIZE(ngw_leds),
.leds = (void *) ngw_leds,
};
 
static struct platform_device ngw_gpio_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = (void *) &ngw_led_data,
}
};
 
#ifdef CONFIG_BOARD_ATNGW100_I2C_GPIO
static struct i2c_gpio_platform_data i2c_gpio_data = {
.sda_pin = GPIO_PIN_PA(6),
.scl_pin = GPIO_PIN_PA(7),
};
 
static struct platform_device i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0,
.dev = {
.platform_data = &i2c_gpio_data,
},
};
#endif
 
static int __init atngw100_init(void)
{
unsigned i;
 
/*
* ATNGW100 uses 16-bit SDRAM interface, so we don't need to
* reserve any pins for it.
*/
 
at32_add_system_devices();
 
at32_add_device_usart(0);
at32_add_device_usart(1);
 
set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
 
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
at32_add_device_mci(0, &mci0_data);
at32_add_device_usba(0, NULL);
 
for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) {
at32_select_gpio(ngw_leds[i].gpio,
AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
}
platform_device_register(&ngw_gpio_leds);
 
#ifdef CONFIG_BOARD_ATNGW100_I2C_GPIO
at32_select_gpio(i2c_gpio_data.sda_pin, 0);
at32_select_gpio(i2c_gpio_data.scl_pin, 0);
platform_device_register(&i2c_gpio_device);
#else
at32_add_device_twi(0);
#endif
at32_add_device_ac97c (0);
 
return 0;
}
postcore_initcall(atngw100_init);
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programy/C/avr32/linux-kernel/config
0,0 → 1,1052
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.22.atmel.2
# Wed Aug 8 23:52:11 2007
#
CONFIG_AVR32=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_TIME=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_BUG=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
 
#
# General setup
#
CONFIG_LOCALVERSION="-kaklik"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_IPC_NS is not set
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
# CONFIG_TASKSTATS is not set
# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=1
 
#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
 
#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
 
#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
 
#
# System Type and features
#
CONFIG_SUBARCH_AVR32B=y
CONFIG_MMU=y
CONFIG_PERFORMANCE_COUNTERS=y
CONFIG_PLATFORM_AT32AP=y
CONFIG_CPU_AT32AP7000=y
# CONFIG_BOARD_ATSTK1000 is not set
CONFIG_BOARD_ATNGW100=y
# CONFIG_BOARD_ATNGW100_I2C_GPIO is not set
CONFIG_LOADER_U_BOOT=y
 
#
# Atmel AVR32 AP options
#
# CONFIG_AP7000_32_BIT_SMC is not set
CONFIG_AP7000_16_BIT_SMC=y
# CONFIG_AP7000_8_BIT_SMC is not set
CONFIG_GPIO_DEV=y
CONFIG_LOAD_ADDRESS=0x10000000
CONFIG_ENTRY_ADDRESS=0x90000000
CONFIG_PHYS_OFFSET=0x10000000
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
# CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set
# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set
# CONFIG_NEED_NODE_MEMMAP_SIZE is not set
CONFIG_ARCH_FLATMEM_ENABLE=y
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
# CONFIG_ARCH_SPARSEMEM_ENABLE is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
# CONFIG_OWNERSHIP_TRACE is not set
CONFIG_DW_DMAC=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
CONFIG_CMDLINE=""
 
#
# Power managment options
#
 
#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
 
#
# Bus options
#
# CONFIG_ARCH_SUPPORTS_MSI is not set
 
#
# PCCARD (PCMCIA/CardBus) support
#
# CONFIG_PCCARD is not set
 
#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
 
#
# Networking
#
CONFIG_NET=y
 
#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
CONFIG_NET_KEY=y
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_ASK_IP_FIB_HASH is not set
# CONFIG_IP_FIB_TRIE is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
# CONFIG_SCTP_HMAC_MD5 is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
 
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
 
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
 
#
# Wireless
#
# CONFIG_CFG80211 is not set
# CONFIG_WIRELESS_EXT is not set
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
# CONFIG_RFKILL is not set
 
#
# Device Drivers
#
 
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
# CONFIG_FW_LOADER is not set
# CONFIG_SYS_HYPERVISOR is not set
 
#
# Connector - unified userspace <-> kernelspace linker
#
# CONFIG_CONNECTOR is not set
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
 
#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
 
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
 
#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x80000000
CONFIG_MTD_PHYSMAP_LEN=0x0
CONFIG_MTD_PHYSMAP_BANKWIDTH=2
# CONFIG_MTD_PLATRAM is not set
 
#
# Self-contained MTD device drivers
#
CONFIG_MTD_DATAFLASH=y
# CONFIG_MTD_M25P80 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
 
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_NAND is not set
# CONFIG_MTD_ONENAND is not set
 
#
# UBI - Unsorted block images
#
# CONFIG_MTD_UBI is not set
 
#
# Parallel port support
#
# CONFIG_PARPORT is not set
 
#
# Plug and Play support
#
# CONFIG_PNPACPI is not set
 
#
# Block devices
#
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
 
#
# Misc devices
#
# CONFIG_IDE is not set
 
#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_NETLINK is not set
# CONFIG_ATA is not set
 
#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
 
#
# Network device support
#
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
CONFIG_PHYLIB=y
 
#
# MII PHY device drivers
#
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_FIXED_PHY is not set
 
#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
CONFIG_MACB=y
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
 
#
# Wireless LAN
#
# CONFIG_WLAN_PRE80211 is not set
# CONFIG_WLAN_80211 is not set
# CONFIG_WAN is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
# CONFIG_SLIP is not set
CONFIG_SLHC=m
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
 
#
# ISDN subsystem
#
# CONFIG_ISDN is not set
 
#
# Telephony Support
#
# CONFIG_PHONE is not set
 
#
# Input device support
#
# CONFIG_INPUT is not set
 
#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set
 
#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set
 
#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set
 
#
# Non-8250 serial port support
#
CONFIG_SERIAL_ATMEL=y
CONFIG_SERIAL_ATMEL_CONSOLE=y
# CONFIG_SERIAL_ATMEL_TTYAT is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
 
#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
 
#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
CONFIG_AT32AP700X_WDT=y
CONFIG_AT32AP700X_WDT_TIMEOUT=2
# CONFIG_HW_RANDOM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
 
#
# TPM devices
#
# CONFIG_TCG_TPM is not set
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
 
#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_ALGOPCF is not set
# CONFIG_I2C_ALGOPCA is not set
 
#
# I2C Hardware Bus support
#
CONFIG_I2C_ATMELTWI=y
CONFIG_I2C_ATMELTWI_BAUDRATE=100000
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_STUB is not set
 
#
# Miscellaneous I2C Chip support
#
# CONFIG_SENSORS_DS1337 is not set
# CONFIG_SENSORS_DS1374 is not set
# CONFIG_SENSORS_EEPROM is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_SENSORS_PCA9539 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_MAX6875 is not set
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
CONFIG_I2C_DEBUG_CHIP=y
 
#
# SPI support
#
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
 
#
# SPI Master Controller Drivers
#
CONFIG_SPI_ATMEL=y
# CONFIG_SPI_BITBANG is not set
 
#
# SPI Protocol Masters
#
# CONFIG_SPI_AT25 is not set
CONFIG_SPI_SPIDEV=m
 
#
# Dallas's 1-wire bus
#
# CONFIG_W1 is not set
# CONFIG_HWMON is not set
 
#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
 
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_DVB_CORE is not set
# CONFIG_DAB is not set
 
#
# Graphics support
#
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
#
# Display device support
#
# CONFIG_DISPLAY_SUPPORT is not set
# CONFIG_VGASTATE is not set
# CONFIG_FB is not set
 
#
# Sound
#
CONFIG_SOUND=y
 
#
# Advanced Linux Sound Architecture
#
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
# CONFIG_SND_SEQUENCER is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
CONFIG_SND_DEBUG_DETECT=y
# CONFIG_SND_PCM_XRUN_DEBUG is not set
 
#
# Generic devices
#
CONFIG_SND_AC97_CODEC=m
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
 
#
# ALSA AVR32 devices
#
CONFIG_SND_ATMEL_AC97=m
# CONFIG_SND_ATMEL_AC97_USE_ALSA_MALLOC_CALLS is not set
# CONFIG_SND_ATMEL_AC97C_USE_PDC is not set
 
#
# System on Chip audio support
#
# CONFIG_SND_SOC is not set
 
#
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set
CONFIG_AC97_BUS=m
 
#
# USB support
#
# CONFIG_USB_ARCH_HAS_HCD is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
 
#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
#
 
#
# USB Gadget Support
#
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG_FILES is not set
CONFIG_USB_GADGET_SELECTED=y
# CONFIG_USB_GADGET_FSL_USB2 is not set
# CONFIG_USB_GADGET_NET2280 is not set
# CONFIG_USB_GADGET_PXA2XX is not set
# CONFIG_USB_GADGET_GOKU is not set
# CONFIG_USB_GADGET_LH7A40X is not set
CONFIG_USB_GADGET_ATMEL_USBA=y
CONFIG_USB_ATMEL_USBA=y
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_USB_GADGET_AT91 is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_ZERO=m
CONFIG_USB_ETH=m
CONFIG_USB_ETH_RNDIS=y
CONFIG_USB_GADGETFS=m
CONFIG_USB_FILE_STORAGE=m
# CONFIG_USB_FILE_STORAGE_TEST is not set
CONFIG_USB_G_SERIAL=m
# CONFIG_USB_MIDI_GADGET is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
 
#
# MMC/SD Card Drivers
#
CONFIG_MMC_BLOCK=y
 
#
# MMC/SD Host Controller Drivers
#
CONFIG_MMC_ATMELMCI=y
 
#
# LED devices
#
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
 
#
# LED drivers
#
CONFIG_LEDS_GPIO=y
 
#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 
#
# InfiniBand support
#
 
#
# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
#
 
#
# Real Time Clock
#
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
 
#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set
 
#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
 
#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
 
#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_V3020 is not set
 
#
# on-CPU RTC drivers
#
CONFIG_RTC_DRV_AT32AP700X=y
 
#
# DMA Engine support
#
# CONFIG_DMA_ENGINE is not set
 
#
# DMA Clients
#
 
#
# DMA Devices
#
 
#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_DNOTIFY is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=m
 
#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set
 
#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=850
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set
 
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
CONFIG_CONFIGFS_FS=y
 
#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_SUMMARY is not set
# CONFIG_JFFS2_FS_XATTR is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
 
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_BIND34 is not set
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
CONFIG_SMB_FS=m
# CONFIG_SMB_NLS_DEFAULT is not set
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
# CONFIG_CIFS_WEAK_PW_HASH is not set
# CONFIG_CIFS_XATTR is not set
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_EXPERIMENTAL is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_9P_FS is not set
 
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
 
#
# Native Language Support
#
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=y
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
CONFIG_NLS_UTF8=y
 
#
# Distributed Lock Manager
#
# CONFIG_DLM is not set
 
#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_PRINTK_TIME is not set
CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_KERNEL is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
 
#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
 
#
# Cryptographic options
#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_SHA1=y
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_GF128MUL is not set
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_PCBC=m
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_DEFLATE=y
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_TEST is not set
 
#
# Hardware crypto devices
#
 
#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_CRC_CCITT=m
# CONFIG_CRC16 is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
/programy/C/avr32/SID/fftw3/compile
0,0 → 1,0
$ ./configure CC=avr32-linux-gcc --host=avr32 --with-gcc-arch=ap --disable-fortran --prefix=/usr/avr32-linux/
/programy/C/avr32/SID/sidd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/SID/README
0,0 → 1,155
Installation and setup notes for sidd-0.93, 15th March 2005.
------------------------------------------------------------
 
You have unpacked the tgz file and have 3 files:-
 
* README - this one
* sidd.c - source code
* sidd.conf - a sample configuration file.
 
Installation steps
------------------
* 1/
You will need FFTW3 from www.fftw.org, if not already installed.
 
* 2/
Compile the sidd source with
 
gcc -Wall -O4 -ffast-math -DPENTIUM -Wall -o sidd sidd.c -lfftw3 -lm
 
which produces an executable sidd in the current directory.
 
* 3/
Edit sidd.conf to suit your requirements.
 
* 4/
Start sidd in verbose foreground mode with the command
 
./sidd -vf
 
* 5/
Examine the log file - it should look something like
 
2005/03/15 20:03:17 logfile /root/sidd.log
2005/03/15 20:03:17 los threshold 0.060, timeout 5 seconds
2005/03/15 20:03:17 band LB 18200 18400
2005/03/15 20:03:17 band AN 19480 19680
2005/03/15 20:03:17 band SK 22050 22150
2005/03/15 20:03:17 band BG 23300 23500
2005/03/15 20:03:17 band TV 20190 20340
2005/03/15 20:03:17 band NV 16300 16500
2005/03/15 20:03:17 band B1 20800 21000
2005/03/15 20:03:17 band B2 22650 22850
2005/03/15 20:03:17 requesting line input gains left=77 right=100
2005/03/15 20:03:17 line input gains set to: left=77 right=100
2005/03/15 20:03:17 taking data from [/dev/dsp]
2005/03/15 20:03:17 requesting rate 48000
2005/03/15 20:03:17 actual rate set: 48662 samples/sec
2005/03/15 20:03:17 soundcard channels: 1 bits: 16
2005/03/15 20:03:17 resolution: bins=2048 fftwid=4096 df=11.880371
2005/03/15 20:03:17 spectrum file: /tmp/sidspec
2005/03/15 20:03:17 using SCHED_FIFO priority 1
2005/03/15 20:03:17 sidd version 0.93: starting work
2005/03/15 20:03:17 using output file [./050315.dat]
 
* 6/
Now tail the output file (in my example, ./050315.dat). The first
three columns are the timestamp (seconds from 01/01/1970), peak signal
level (range 0 to 1), and rms signal level (also range 0 to 1).
 
Adjust your mixer gain settings so that the peak hovers around the
range 0.1 to 0.5 (the rms will be around 1/2 or 1/3 of the peak, depending
on your level of impulsive noise and sferics).
 
* 7/
Plot the spectrum file, in my case /tmp/sidspec. This file is two columns,
bin centre frequency in Hz, and relative power. The file is re-written by
sidd every 10 seconds or so, depending on your sidd.conf settings. Adjust
antennas, receivers, etc to obtain desired signal to noise ratios. You
may want to reconsider the band settings in sidd.conf at this point too.
 
* 8/
Once you're happy with the gain settings, stop sidd and run it again with
the command
 
./sidd -m
 
This will read and display the applicable mixer gain settings. Now edit
your sidd.conf, commenting in the gain commands and putting in your gain
settings. Then, whenever sidd starts, it will setup the mixer with these
settings. All mixers will have a line input gain control, but only some
will have an overall input gain control and/or a record level control.
The -m option will report what you need to put in the config file.
 
* 9/
Set your PC clock and activate your favourite time synchronisation
software. Make sure it slews the clock rather than stepping the time.
 
* 10/
Restart sidd in background with
 
./sidd -v
 
Inspect the log file to make sure your mixer settings have been applied.
 
* 11/
After a period of time, plot some of the data from the output file.
Output file columns 4 onwards correspond to the 'band' commands in the
order they appear in sidd.conf. Each column is a total relative power,
so you will need to apply a square root function during plotting if you
want to display relative amplitudes.
 
* 12/
After a midnight crossing, make sure sidd has switched to the next
output file.
 
Command line options
--------------------
There are just a few command line options - most controls are
in the config file.
 
-v Be a little more verbose with log messages.
-f Run in foreground. By default, sidd detaches from the process
group and terminal and becomes a daemon. In foreground mode,
log messages are duplicated to stderr.
-m Interrogate the soundcard mixer and report settings, then exit.
This option overrides any others.
 
Miscellaneous notes
-------------------
*
sidd will set the soundcard to the nearest available sample rate to that
specified in sidd.conf
 
*
Make sure you have enough disk space. The example sidd.conf with 8 bands
generates files of about 100Mbytes per day, which compress down to about
30Mbytes. Arrange scripts for plotting. Arrange scripts for compressing
and archiving files that are a few days old.
 
*
You can specify an ordinary file or a pipe as the input 'device' instead
of /dev/dsp. In this case, you must set the sample rate in sidd.conf
to whatever the actual sample rate is. sidd is looking for unsigned bytes
in 8 bit mode, or signed words in 16 bit mode.
 
*
Once sidd has started up and set the mixer gains, it no longer takes any
notice of the mixer. Therefore once sidd is running, a rogue user can
mess things up by twiddling the mixer settings with Xmixer or some other
utility. Kill off any mixer control panels to avoid the risk of any upset.
 
*
If your PC is set to autoboot after a power outage, you might want to put
a startup command for sidd into /etc/rc.d/rc.local or similar - but make
sure the RTC setting commands are done first.
 
Revisions
---------
v0.9: Original.
v0.91: Fixes a header file problem with some gcc.
No longer produces a static binary.
v0.93: Another bug fixed.
Added control of mixer input and gains.
Added stereo mode to make a 2 channel monitor.
 
/programy/C/avr32/SID/sidd.c
0,0 → 1,928
//
// sidd.c: A VLF signal monitor.
//
// author: Paul Nicholson, paul@abelian.demon.co.uk
//
 
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/param.h>
#include <fcntl.h>
#include <errno.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sched.h>
#include <linux/soundcard.h>
 
#include <fftw3.h>
 
///////////////////////////////////////////////////////////////////////////////
// Tuneable Settings //
///////////////////////////////////////////////////////////////////////////////
 
#define VERSION "0.93"
 
//
// Number of soundcard bytes to read at a time.
#define NREAD 2048
 
//
// Max number of bands which can be read from the config file.
#define MAXBANDS 20
 
//
// Name of the configuration file.
#define CONFIG_FILE "sidd.conf"
 
///////////////////////////////////////////////////////////////////////////////
// Globals and fixed definitions //
///////////////////////////////////////////////////////////////////////////////
//
// Default values here are over-ridden by the config file.
 
int mode = 1; // 1 = mono, 2 = stereo
int bits = 16; // Sample width, 8 or 16 bits
int BINS = 2048; // Number of frequency bins
#define FFTWID (2 * BINS) // Number of samples in FFT period
 
int background = 1; // Set zero if running in foreground
int fdi; // Input file handle
int fdm; // Mixer file handle
int VFLAG = 0; // Set non-zero by -v option
int MFLAG = 0; // Set non-zero by -m option
 
int spec_max = 100; // Issue a spectrum for every spec_max output records
int spec_cnt = 0;
int sample_rate = 100000; // Samples per second
 
int chans = 1;
int alert_on = 0;
 
int priority = 0; // Set to 1 if high scheduling priority
struct sigaction sa;
char mailaddr[100];
 
double los_thresh = 0; // Threshold for loss of signal, 0..1
int los_timeout = 0; // Number of seconds before loss of signal declared
 
double DF; // Frequency resolution of the FFT
int bailout_flag = 0; // To prevent bailout() looping
int grab_cnt = 0; // Count of samples into the FFT buffer
 
// Mixer gain settings requested by config file.
int req_lgain = -1; // Line gain
int req_igain = -1; // Input gain
int req_rgain = -1; // Record level
 
//
// Various filenames, contents set by config file.
//
char logfile[100] = "";
char device[100] = "/dev/dsp";
char mixer[100] = "/dev/mixer";
char spectrum_file[100] = "/tmp/sidspec";
char datadir[100] = ".";
 
//
// Table of frequency bands to monitor
//
 
struct BAND
{
char ident[50];
 
int start;
int end;
}
bands[MAXBANDS]; // Table of bands to be monitored
 
int nbands = 0;
 
//
// Independent state variables and buffers for left and right channels
//
struct CHAN
{
char *name;
double *signal_avg;
double *powspec;
double *fft_inbuf;
fftw_complex *fft_data;
fftw_plan ffp;
double peak;
double sum_sq;
int los_state;
time_t los_time;
FILE *fo;
char fname[100];
}
left = { "left" }, right = { "right" };
 
///////////////////////////////////////////////////////////////////////////////
// Various Utility Functions //
///////////////////////////////////////////////////////////////////////////////
 
//
// Issue a message to the log file, if the verbosity level is high enough...
//
 
void report( int level, char *format, ...)
{
va_list ap;
void bailout( char *format, ...);
char temp[ 200];
 
if( VFLAG < level) return;
 
va_start( ap, format);
vsprintf( temp, format, ap);
va_end( ap);
 
if( !logfile[0] || !background)
if( background != 2) fprintf( stderr, "%s\n", temp);
 
if( logfile[0])
{
time_t now = time( NULL);
struct tm *tm = gmtime( &now);
FILE *flog = NULL;
if( (flog = fopen( logfile, "a+")) == NULL)
bailout( "cannot open logfile [%s]: %s", logfile, strerror( errno));
fprintf( flog, "%04d/%02d/%02d %02d:%02d:%02d %s\n",
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec, temp);
fclose( flog);
}
}
 
void alert( char *format, ...)
{
FILE *f;
va_list( ap);
char cmd[100], temp[100];
 
va_start( ap, format);
vsprintf( temp, format, ap);
va_end( ap);
report( -1, "%s", temp);
 
if( !alert_on || !mailaddr[0]) return;
 
sprintf( cmd, "mail -s 'sidd alert' '%s'", mailaddr);
if( (f=popen( cmd, "w")) == NULL)
{
report( 0, "cannot exec [%s]: %s", cmd, strerror( errno));
return;
}
 
fprintf( f, "sidd: %s\n", temp);
fclose( f);
}
 
//
// We try to exit the program through here, if possible.
//
 
void bailout( char *format, ...)
{
va_list ap;
char temp[ 200];
 
if( bailout_flag) exit( 1);
bailout_flag = 1;
va_start( ap, format);
vsprintf( temp, format, ap);
va_end( ap);
 
alert( "terminating: %s", temp);
exit( 1);
}
 
//
// Exit with a message if we get any signals.
//
 
void handle_sigs( int signum)
{
bailout( "got signal %d", signum);
}
 
///////////////////////////////////////////////////////////////////////////////
// Soundcard Setup //
///////////////////////////////////////////////////////////////////////////////
 
//
// Prepare the input stream, setting up the soundcard if the input
// is a character device.
//
 
void setup_input_stream( void)
{
struct stat st;
 
report( 1, "taking data from [%s]", device);
 
if( (fdi = open( device, O_RDONLY)) < 0)
bailout( "cannot open [%s]: %s", strerror( errno));
 
if( fstat( fdi, &st) < 0)
bailout( "cannot stat input stream: %s", strerror( errno));
 
if( S_ISCHR( st.st_mode))
{
int blksize;
int fragreq = 0x7fff000a;
unsigned int format;
unsigned int req_format = AFMT_S16_LE;
if( bits == 8) req_format = AFMT_U8;
 
if (ioctl( fdi, SNDCTL_DSP_SETFRAGMENT, &fragreq))
report( 01, "cannot set fragment size");
 
if( ioctl( fdi, SNDCTL_DSP_RESET, NULL) < 0)
bailout( "cannot reset input device");
 
chans = mode;
if( ioctl( fdi, SNDCTL_DSP_CHANNELS, &chans) < 0)
bailout( "cannot set channels on input device");
 
if( ioctl( fdi, SNDCTL_DSP_GETFMTS, &format) < 0)
bailout( "cannot get formats from input device");
 
report( 2, "formats available: %08X", format);
if( (format & req_format) == 0)
{
report( 0, "available dsp modes are %08X", format);
bailout( "unable to set %d bit dsp mode", bits);
}
 
format = req_format;
if( ioctl( fdi, SNDCTL_DSP_SETFMT, &format) < 0)
bailout( "cannot set dsp format on input device");
 
if( ioctl( fdi, SNDCTL_DSP_GETBLKSIZE, &blksize) < 0)
bailout( "cannot get block size from input device");
 
report( 2, "dsp block size: %d", blksize);
if( ioctl( fdi, SNDCTL_DSP_CHANNELS, &chans) < 0)
bailout( "cannot get channels from input device");
 
report( 1, "requesting rate %d", sample_rate);
if( ioctl( fdi, SNDCTL_DSP_SPEED, &sample_rate) < 0)
bailout( "cannot set sample rate of input device");
 
report( 1, "actual rate set: %d samples/sec", sample_rate);
report( 1, "soundcard channels: %d bits: %d", chans, bits);
}
}
 
///////////////////////////////////////////////////////////////////////////////
// Output Functions //
///////////////////////////////////////////////////////////////////////////////
 
void maybe_output_spectrum( void)
{
FILE *f;
int i;
 
if( ++spec_cnt < spec_max) return; // Wait for spec_max records
spec_cnt = 0;
 
if( !spectrum_file[0]) return; // Spectrum file not wanted.
 
if( (f=fopen( spectrum_file, "w+")) == NULL)
bailout( "cannot open spectrum file %s, %s", strerror( errno));
 
if( mode == 1){
fprintf( f, "Frequency PowerL \n");
for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e\n",
(i+0.5) * DF, left.signal_avg[i]/spec_max);}
else{
fprintf( f, "Frequncy PowerL PowerR \n");
for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e %.5e\n",
(i+0.5) * DF, left.signal_avg[i]/spec_max,
right.signal_avg[i]/spec_max);}
fclose( f);
 
for( i=0; i<BINS; i++) left.signal_avg[i] = 0;
if( mode == 2) for( i=0; i<BINS; i++) right.signal_avg[i] = 0;
}
 
void output_record( struct CHAN *c, char *prefix, double fsecs)
{
int i, j;
char test[100];
 
if( mode == 1)
sprintf( test, "%s.dat", prefix);
else
sprintf( test, "%s.%s.dat", prefix, c->name);
if( !c->fo || strcmp( test, c->fname))
{
if( c->fo) fclose( c->fo);
strcpy( c->fname, test);
report( 0, "using output file [%s]", c->fname);
if( (c->fo=fopen( c->fname, "a+")) == NULL)
bailout( "cannot open [%s], %s", c->fname, strerror( errno));
}
 
fprintf( c->fo, "%.3f %.3f %.3f", fsecs, c->peak, sqrt( c->sum_sq/FFTWID));
 
for( i=0; i<nbands; i++)
{
double e = 0;
int n1 = bands[i].start/DF;
int n2 = bands[i].end/DF;
for( j=n1; j<= n2; j++) e += c->powspec[j];
e /= n2 - n1 + 1;
fprintf( c->fo, " %.2e", e);
}
fprintf( c->fo, "\n");
fflush( c->fo);
 
c->peak = c->sum_sq = 0;
}
 
void output_records( void)
{
struct timeval tv;
struct tm *tm;
double fsecs;
time_t ud;
char prefix[100];
 
gettimeofday( &tv, NULL);
fsecs = tv.tv_sec + 1e-6 * tv.tv_usec;
ud = tv.tv_sec - tv.tv_sec % 86400;
tm = gmtime( &ud);
sprintf( prefix, "%s/%02d%02d%02d", datadir,
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
 
output_record( &left, prefix, fsecs);
if( mode == 2) output_record( &right, prefix, fsecs);
}
 
void check_los( struct CHAN *c)
{
if( !c->los_state)
{
if( !c->los_time && c->peak < los_thresh) time( &c->los_time);
if( c->los_time && c->peak > los_thresh) c->los_time = 0;
if( c->los_time && c->los_time + los_timeout < time( NULL))
{
c->los_state = 1;
c->los_time = 0;
if( mode == 1) alert( "loss of signal");
else alert( "loss of signal on %s", c->name);
}
}
else
{
if( !c->los_time && c->peak > los_thresh) time( &c->los_time);
if( c->los_time && c->peak < los_thresh) c->los_time = 0;
if( c->los_time && c->los_time + los_timeout < time( NULL))
{
c->los_state = 0;
c->los_time = 0;
if( mode == 1) alert( "signal restored");
else alert( "signal restored on %s", c->name);
}
}
}
 
///////////////////////////////////////////////////////////////////////////////
// Signal Processing //
///////////////////////////////////////////////////////////////////////////////
 
void process_fft( struct CHAN *c)
{
int i;
 
//
// Do the FFT. First time through, initialise the fft plan.
//
 
if( !c->ffp)
c->ffp = fftw_plan_dft_r2c_1d( FFTWID, c->fft_inbuf, c->fft_data,
FFTW_ESTIMATE | FFTW_DESTROY_INPUT);
 
fftw_execute( c->ffp);
 
//
// Obtain squared amplitude of each bin.
//
 
c->powspec[ 0] = 0.0; // Zero the DC component
for( i=1; i<BINS; i++)
{
double t1 = c->fft_data[ i][0];
double t2 = c->fft_data[ i][1];
c->powspec[ i] = t1*t1 + t2*t2;
}
 
//
// Accumulate average signal levels in each bin. signal_avg is used
// only for the spectrum file output.
//
 
for( i=0; i<BINS; i++) c->signal_avg[ i] += c->powspec[i];
check_los( c);
}
 
void insert_sample( struct CHAN *c, double f)
{
c->sum_sq += f * f;
if( f > c->peak) c->peak = f;
if( f < -c->peak) c->peak = -f;
 
c->fft_inbuf[ grab_cnt] = f * sin( grab_cnt/(double) FFTWID * M_PI);
}
 
void maybe_do_fft( void)
{
if( ++grab_cnt < FFTWID) return;
grab_cnt = 0;
 
process_fft( &left);
if( mode == 2) process_fft( &right);
 
output_records();
maybe_output_spectrum();
}
 
//
// Main signal processing loop. Never returns.
//
 
void process_signal( void)
{
unsigned char buff[ NREAD];
 
while( 1)
{
int i, q;
 
if( (q=read( fdi, buff, NREAD)) <= 0)
{
if( !q || errno == ENOENT || errno == 0)
{
sched_yield();
usleep( 50000);
continue;
}
 
report( 0, "input file: read error, count=%d errno=%d", q, errno);
exit( 1);
}
 
// Unpack the input buffer into signed 16 bit words.
// then scale to -1..+1 for further processing.
// We use 'chans' to decide if the soundcard is giving stereo or
// mono samples, rather than 'mode', because some cards will refuse
// to do mono.
if( bits == 16)
{
if( chans == 1)
{
for( i=0; i<q; i += 2)
{
int fh = *(short *)(buff + i);
insert_sample( &left, fh/32768.0);
maybe_do_fft();
}
}
else // chans must be 2
{
if( mode == 1)
for( i=0; i<q; i += 4)
{
int fh = *(short *)(buff + i);
insert_sample( &left, fh/32768.0);
maybe_do_fft();
}
else // mode == 2
for( i=0; i<q; i += 4)
{
int fh = *(short *)(buff + i);
insert_sample( &left, fh/32768.0);
fh = *(short *)(buff + i + 2);
insert_sample( &right, fh/32768.0);
maybe_do_fft();
}
}
}
else // bits must be 8
{
if( chans == 1)
{
for( i=0; i<q; i++)
{
int fh = ((short)buff[i] - 128)*256;
insert_sample( &left, fh/32768.0);
maybe_do_fft();
}
}
else // chans must be 2
{
if( mode == 1)
for( i=0; i<q; i += 2)
{
int fh = ((short)buff[i] - 128)*256;
insert_sample( &left, fh/32768.0);
maybe_do_fft();
}
else // mode == 2
for( i=0; i<q; i += 2)
{
int fh = ((short)buff[i] - 128)*256;
insert_sample( &left, fh/32768.0);
fh = ((short)buff[i+1] - 128)*256;
insert_sample( &right, fh/32768.0);
maybe_do_fft();
}
}
}
}
}
 
///////////////////////////////////////////////////////////////////////////////
// Configuration File Stuff //
///////////////////////////////////////////////////////////////////////////////
 
void config_band( char *ident, char *start, char *end)
{
struct BAND *b = bands + nbands++;
 
if( nbands == MAXBANDS) bailout( "too many bands specified in config file");
 
strcpy( b->ident, ident);
b->start = atoi( start);
b->end = atoi( end);
 
report( 1, "band %s %d %d", b->ident, b->start, b->end);
}
 
void load_config( void)
{
int lino = 0, nf;
FILE *f;
char buff[100], *p, *fields[20];
 
if( (f=fopen( CONFIG_FILE, "r")) == NULL)
bailout( "no config file found");
 
while( fgets( buff, 99, f))
{
lino++;
 
if( (p=strchr( buff, '\r')) != NULL) *p = 0;
if( (p=strchr( buff, '\n')) != NULL) *p = 0;
if( (p=strchr( buff, ';')) != NULL) *p = 0;
 
p = buff; nf = 0;
while( 1)
{
while( *p && isspace( *p)) p++;
if( !*p) break;
fields[nf++] = p;
while( *p && !isspace( *p)) p++;
if( *p) *p++ = 0;
}
if( !nf) continue;
 
if( nf == 4 && !strcasecmp( fields[0], "band"))
config_band( fields[1], fields[2], fields[3]);
else
if( nf == 2 && !strcasecmp( fields[0], "logfile"))
{
strcpy( logfile, fields[1]);
report( 1, "logfile %s", logfile);
}
else
if( nf == 3 && !strcasecmp( fields[0], "los"))
{
los_thresh = atof( fields[1]);
los_timeout = atoi( fields[2]);
report( 1, "los threshold %.3f, timeout %d seconds",
los_thresh, los_timeout);
}
else
if( nf == 2 && !strcasecmp( fields[0], "device"))
strcpy( device, fields[1]);
else
if( nf == 2 && !strcasecmp( fields[0], "mixer"))
strcpy( mixer, fields[1]);
else
if( nf == 2 && !strcasecmp( fields[0], "mode"))
{
if( !strcasecmp( fields[1], "mono")) mode = 1;
else
if( !strcasecmp( fields[1], "stereo")) mode = 2;
else
bailout( "error in config file, line %d", lino);
}
else
if( nf == 2 && !strcasecmp( fields[0], "bits"))
{
bits = atoi( fields[1]);
if( bits != 8 && bits != 16)
bailout( "can only do 8 or 16 bits, config file line %d", lino);
}
else
if( nf == 3 && !strcasecmp( fields[0], "spectrum"))
{
strcpy( spectrum_file, fields[1]);
spec_max = atoi( fields[2]);
}
else
if( nf == 2 && !strcasecmp( fields[0], "sched")
&& !strcasecmp( fields[1], "high"))
{
priority = 1;
}
else
if( nf == 4 && !strcasecmp( fields[0], "gain"))
{
int left = atoi( fields[2]);
int right = atoi( fields[3]);
int gain = (right << 8) | left;
 
if( !strcasecmp( fields[1], "line")) req_lgain = gain;
else
if( !strcasecmp( fields[1], "overall")) req_igain = gain;
else
if( !strcasecmp( fields[1], "record")) req_rgain = gain;
else
bailout( "unknown gain control [%s]", fields[1]);
}
else
if( nf == 2 && !strcasecmp( fields[0], "rate"))
sample_rate = atoi( fields[1]);
else
if( nf == 2 && !strcasecmp( fields[0], "bins"))
BINS = atoi( fields[1]);
else
if( nf == 2 && !strcasecmp( fields[0], "datadir"))
{
struct stat st;
strcpy( datadir, fields[1]);
if( stat( datadir, &st) < 0 || !S_ISDIR( st.st_mode))
bailout( "no data directory, %s", datadir);
}
else
bailout( "error in config file, line %d", lino);
}
 
fclose( f);
}
 
///////////////////////////////////////////////////////////////////////////////
// Mixer Stuff //
///////////////////////////////////////////////////////////////////////////////
 
// Actual mixer values, read by open_mixer()
int mixer_recmask; // Recording device mask
int mixer_stereo; // Stereo device mask
int mixer_line; // Line input gain setting
int mixer_igain; // Overall input gain setting
int mixer_reclev; // Recording level setting
int mixer_recsrc; // Mask indicating which inputs are set to record
 
void open_mixer( void)
{
if( (fdm = open( mixer, O_RDWR)) < 0)
bailout( "cannot open [%s]: %s", mixer, strerror( errno));
 
// Determine the available mixer recording gain controls.
// We must at least have a line input.
 
if( ioctl( fdm, SOUND_MIXER_READ_RECMASK, &mixer_recmask) < 0)
bailout( "cannot read mixer devmask");
 
if( (mixer_recmask & SOUND_MASK_LINE) == 0)
bailout( "mixer has no line device");
 
if( ioctl( fdm, SOUND_MIXER_READ_STEREODEVS, &mixer_stereo) < 0)
bailout( "cannot read mixer stereodevs");
 
if( ioctl( fdm, SOUND_MIXER_READ_RECSRC, &mixer_recsrc) < 0)
bailout( "cannot read mixer recsrc");
 
// Read the line input gain.
if( ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0)
bailout( "cannot read mixer line");
 
// Read overall input gain? Optional.
if( (mixer_recmask & SOUND_MASK_IGAIN) &&
ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0)
bailout( "cannot read mixer igain");
 
// Read overall recording level? Optional.
if( (mixer_recmask & SOUND_MASK_RECLEV) &&
ioctl( fdm, SOUND_MIXER_READ_RECLEV, &mixer_reclev) < 0)
bailout( "cannot read mixer reclev");
}
 
void report_mixer_settings( void)
{
report( 1, "mixer: line input is %s",
mixer_stereo & SOUND_MASK_LINE ? "stereo" : "mono");
 
report( 1, "mixer: line input is %s",
mixer_recsrc & SOUND_MASK_LINE ? "on" : "off");
 
report( 1, "mixer: line input gain: left=%d right=%d",
mixer_line & 0xff, (mixer_line >> 8) & 0xff);
 
// Overall input gain? Optional.
if( mixer_recmask & SOUND_MASK_IGAIN)
{
report( 1, "mixer: igain: left=%d right=%d",
mixer_igain & 0xff, (mixer_igain >> 8) & 0xff);
}
else report( 1, "mixer: igain: n/a");
 
// Overall recording level? Optional.
if( mixer_recmask & SOUND_MASK_RECLEV)
{
report( 1, "mixer: reclev: left=%d right=%d",
mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff);
}
else report( 1, "mixer: reclev: n/a");
 
}
 
void setup_mixer( void)
{
if( req_lgain >= 0)
{
report( 1, "requesting line input gains left=%d right=%d",
req_lgain & 0xff, (req_lgain >> 8) & 0xff);
 
if( ioctl( fdm, SOUND_MIXER_WRITE_LINE, &req_lgain) < 0 ||
ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0)
bailout( "error setting mixer line gain");
 
report( 1, "line input gains set to: left=%d right=%d",
mixer_line & 0xff, (mixer_line >> 8) & 0xff);
}
 
if( req_igain >= 0 &&
(mixer_recmask & SOUND_MASK_IGAIN))
{
report( 1, "requesting overall input gains left=%d right=%d",
req_igain & 0xff, (req_igain >> 8) & 0xff);
 
if( ioctl( fdm, SOUND_MIXER_WRITE_IGAIN, &req_igain) < 0 ||
ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0)
bailout( "error setting mixer overall input gain");
 
report( 1, "overall input gains set to: left=%d right=%d",
mixer_igain & 0xff, (mixer_igain >> 8) & 0xff);
}
 
if( req_rgain >= 0 &&
(mixer_recmask & SOUND_MASK_RECLEV))
{
report( 1, "requesting overall record levels left=%d right=%d",
req_rgain & 0xff, (req_rgain >> 8) & 0xff);
 
if( ioctl( fdm, SOUND_MIXER_WRITE_RECLEV, &req_rgain) < 0 ||
ioctl( fdm, SOUND_MIXER_READ_RECLEV, &mixer_reclev) < 0)
bailout( "error setting mixer record level");
 
report( 1, "mixer record levels set to: left=%d right=%d",
mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff);
}
 
mixer_recsrc = SOUND_MASK_LINE;
if( ioctl( fdm, SOUND_MIXER_WRITE_RECSRC, &mixer_recsrc) < 0)
bailout( "cannot set mixer recsrc to line");
}
 
///////////////////////////////////////////////////////////////////////////////
// Main //
///////////////////////////////////////////////////////////////////////////////
 
void make_daemon( void)
{
int childpid, fd;
 
if( (childpid = fork()) < 0)
bailout( "cannot fork: %s", strerror( errno));
else if( childpid > 0) exit( 0);
 
if( setpgrp() == -1) bailout( "cannot setpgrp");
 
if( (childpid = fork()) < 0)
bailout( "cannot fork: %s", strerror( errno));
else if( childpid > 0) exit( 0);
 
for( fd = 0; fd <NOFILE; fd++) if( fd != fdi) close( fd);
errno = 0;
background = 2;
}
 
void initialise_channel( struct CHAN *c)
{
int i;
 
c->fft_inbuf = (double *) malloc( BINS * 2 * sizeof( double));
c->fft_data = fftw_malloc( sizeof( fftw_complex) * FFTWID);
c->powspec = (double *) malloc( BINS * sizeof( double));
c->signal_avg = (double *) malloc( BINS * sizeof( double));
for( i=0; i<BINS; i++) c->signal_avg[i] = 0;
}
 
void setup_signal_handling( void)
{
sa.sa_handler = handle_sigs;
sigemptyset( &sa.sa_mask);
sa.sa_flags = 0;
sigaction( SIGINT, &sa, NULL);
sigaction( SIGTERM, &sa, NULL);
sigaction( SIGHUP, &sa, NULL);
sigaction( SIGQUIT, &sa, NULL);
sigaction( SIGFPE, &sa, NULL);
sigaction( SIGBUS, &sa, NULL);
sigaction( SIGSEGV, &sa, NULL);
}
 
// Set scheduling priority to the minimum SCHED_FIFO value.
void set_scheduling( void)
{
struct sched_param pa;
int min = sched_get_priority_min( SCHED_FIFO);
 
pa.sched_priority = min;
if( sched_setscheduler( 0, SCHED_FIFO, &pa) < 0)
report( -1, "cannot set scheduling priority: %s", strerror( errno));
else
report( 0, "using SCHED_FIFO priority %d", min);
}
 
int main( int argc, char *argv[])
{
while( 1)
{
int c = getopt( argc, argv, "vfm");
 
if( c == 'v') VFLAG++;
else
if( c == 'm') MFLAG++;
else
if( c == 'f') background = 0;
else if( c == -1) break;
else bailout( "unknown option [%c]", c);
}
 
setup_signal_handling();
load_config();
open_mixer();
 
if( MFLAG)
{
VFLAG = 1;
background = 0;
report_mixer_settings();
exit( 0);
}
 
setup_mixer();
if( background && !logfile[0])
report( -1, "warning: no logfile specified for daemon");
 
setup_input_stream();
DF = (double) sample_rate/(double) FFTWID;
 
report( 1, "resolution: bins=%d fftwid=%d df=%f", BINS, FFTWID, DF);
report( 1, "spectrum file: %s", spectrum_file);
 
initialise_channel( &left);
if( mode == 2) initialise_channel( &right);
 
if( background) make_daemon();
if( priority) set_scheduling();
 
report( 0, "sidd version %s: starting work", VERSION);
alert_on = 1;
process_signal();
return 0;
}
 
/programy/C/avr32/SID/sidd.conf
0,0 → 1,75
; Specify a file into which sidd will write messages.
logfile ./sidd.log
 
; The input device and mixer
device /dev/dsp
mixer /dev/mixer
 
; Specify the mode of operation - stereo or mono. In stereo mode,
; sidd will run two independent monitors, each with its own output file.
 
mode stereo
 
; The requested sample rate. The software will use the closest
; setting available from the soundcard.
rate 48000
 
; Sample size, 8 or 16 bits. 16 bits is strongly recommended, 8 bit is
; provided in case your soundcard or driver doesn't do 16.
 
bits 16
 
; Number of frequency bins to use. The FFT size is 2*bins and the program
; will issue an output record every (2*bins)/rate seconds.
bins 2048
 
; Line input gains, left and right. If using mono, set them both the same.
; Range is 0 to 100. The logfile will report the actual values set, which
; may differ a little.
gain line 77 100
 
; Overall input gains, comments as above.
gain overall 86 100
 
; Overall record level, comments as above.
;; gain record 100 100
 
; Specify a directory to contain daily data files. Use '.' for the
; current directory. Output files will be datadir/yymmdd.dat when running
; in mono, otherwise datadir/yymmdd.left.dat and datadir/yymmdd.right.dat
datadir .
 
; Enable real time scheduling of sidd. Recommended so that soundcard buffers
; are read promptly, which means minimum latency before each fft buffer is
; timestamped. You have to be running as root for this to work.
sched high
 
; Specify the email address of whoever is to get any bad news.
; mail someone@someplace
 
; The loss-of-signal warning threshold and time delay. If the input
; signal peak level (0-1.0) falls below the given threshold for more than
; the delay time, a warning will be issued. The threshold applies to both
; left and right in stereo mode, on the assumption that you've set the gains
; so that the signal levels are about the same anyway.
los 0.06 5
 
; Specify a file into which spectrum data will regularly be written.
; This file is overwritten with a fresh spectrum roughly every
; 100 * 2 * bins/rate seconds. The spectrum file contains three space
; separated columns: bin centre frequency (Hz) and the average power
; in the bin (relative), for the left and right channels. In mono mode,
; there are just two columns
spectrum /tmp/sidspec 100
 
; Specify the channels to monitor. The ident field is not actually used by
; sidd.
;
; ident from to
band 18k3HWU 18200 18400 ; Le Blanc, France, 46:37N 001:05E 162.8 deg 508.6 miles
band 19k6GBZ 19480 19680 ; Anthorn, UK 54:54n 003:18W 329.6 deg 96.4 miles
band 22k1GBZ 22050 22150 ; Skelton, UK, 54:42:24N 2:53:06W 335.0 deg 76.7 miles
band 20k3ICV 20190 20340 ; Tavolara, Italy, 40:55N 009:45E 143.4 deg 1038.8 miles
band B1 20800 21000 ; Background channel
band B2 22650 22850 ; Background channel
 
/programy/C/avr32/hello/hello.elf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/hello/Makefile
0,0 → 1,17
TARGET=hello.elf
OBJECTS=hello.o
CC=avr32-linux-gcc
CFLAGS=-Wall -g # warnings, debugging symbols
LDFLAGS=
LIBS=
 
.PHONY: all
all: $(TARGET)
 
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
.PHONY: clean
clean:
-$(RM) $(TARGET) $(OBJECTS)
/programy/C/avr32/hello/hello.c
0,0 → 1,8
#include <stdio.h>
 
int main(void)
{
printf("Hello World!\n");
return 0;
}
 
/programy/C/avr32/BoardController/BoardController
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/avr32/BoardController/BoardController.cpp
0,0 → 1,176
/*****************************************************************************/
/*
* BoardController.cpp - communication with NGW100 Board controller
*
* Copyright (C) 2007 Karel Hojdar
*
* 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.
*
*
*
* Revision history
* 15.06.2007 1.0 Initial release
*/
/*****************************************************************************/
 
#include <iostream>
 
#include <getopt.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "linux/i2c-dev.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
 
using namespace std;
 
static char* version = "BoardController, version 0.1";
 
static char* help = "Usage: BoardController [OPTION]\n -I\t\tshow ID\n -M\t\tshow model\n -R\t\tshow revision\n -S\t\tshow serial no.\n -T\t\tshow temperature\n\n";
 
#define I2C_SLAVE 0x0703 /* Change slave address */
#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
 
#define BC_Addr 0x0B
 
void DoExit(int ex)
{
exit(ex);
}
 
unsigned char xfunc[5] = {0x99, 0x9A, 0x9B, 0x9E, 0x8D};
unsigned char xlen[5] = {8, 6, 1, 15, 2};
 
int main(int argc, char *argv[], char *envp[])
{
char *progname;
int c, func = 0, Len;
int i2cbus = 0;
char filename[20], Buf[64];
int file;
 
progname = strrchr(argv[0], '/');
progname = progname ? progname + 1 : argv[0];
 
while ((c = getopt (argc, argv, "IiMmRrSsTth")) != -1)
switch (c)
{
case 'I':
case 'i':
func = 0;
break;
 
case 'M':
case 'm':
func = 1;
break;
 
case 'R':
case 'r':
func = 2;
break;
 
case 'S':
case 's':
func = 3;
break;
 
case 'T':
case 't':
func = 4;
break;
 
case 'h':
printf ("%s\n%s", version, help);
return 1;
 
case '?':
printf ("Unknown option `-%c', try %s -h.\n", optopt,progname);
return 1;
}
 
sprintf(filename, "/dev/i2c-%d", i2cbus);
file = open(filename, O_RDWR);
 
if (file < 0)
{
cerr << "Could not open /dev/i2c-0." << endl;
return -1;
}
 
if (ioctl(file, I2C_SLAVE, BC_Addr) == -1)
{
fprintf(stderr, "Failed to set address to 0x%02x.\n", BC_Addr);
DoExit(-2);
}
 
int Loops = 0;
 
do
{
Buf[0] = xfunc[func];
if ( write(file, Buf, 1) != 1)
{
fprintf(stderr, "Failed to write byte to address to 0x%02x, errno %i.\n", BC_Addr, errno);
DoExit(-3);
}
 
if (read(file, Buf, 1) != 1)
{
fprintf(stderr, "Failed to read response length, errno %i.\n", errno);
DoExit(-4);
}
 
Len = Buf[0];
if (read(file, Buf, Len) != Len)
{
fprintf(stderr, "Failed to read response, errno %i.\n", errno);
DoExit(-5);
}
 
Loops++;
} while (Len != xlen[func]);
 
if (Loops > 1)
fprintf(stderr, "After %i attempts got: \n", Loops);
 
switch (func)
{
case 0:
Buf[Len] = 0x00;
fprintf(stdout, "Board ID is %s.\n", Buf);
break;
case 1:
Buf[Len] = 0x00;
fprintf(stdout, "Model of the board is %s.\n", Buf);
break;
case 2:
fprintf(stdout, "Revision of the board is 0x%02X.\n", Buf[0]);
break;
case 3:
Buf[Len] = 0x00;
fprintf(stdout, "Serial number of the board is %s.\n", Buf);
break;
case 4:
fprintf(stdout, "Temperature is %i or %i.\n", (Buf[0] << 8) + Buf[1], (Buf[1] << 8) + Buf[0]);
break;
 
}
 
close(file);
 
return 0;
}
/programy/C/avr32/BoardController/Makefile
0,0 → 1,17
TARGET=BoardController.elf
#OBJECTS=BoardController.o
CC=avr32-linux-c++
CFLAGS=-Wall -g # warnings, debugging symbols
LDFLAGS=
LIBS=
 
.PHONY: all
all: $(TARGET)
 
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
.PHONY: clean
clean:
-$(RM) $(TARGET) $(OBJECTS)