- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The kernell would not build.
------------------------------------------------
Microtronix Linux Extensions
Version 1.3, Built December 30th, 2004
------------------------------------------------
make: Entering directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x'
no emulation specific options.
Using /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x as source for kernel
CHK include/linux/version.h
CHK include/nios2_system.h
HOSTCC scripts/basic/fixdep
scripts/basic/.fixdep.d: done.
HOSTCC scripts/basic/split-include
scripts/basic/.split-include.d: done.
HOSTCC scripts/basic/docproc
scripts/basic/.docproc.d: done.
HOSTCC scripts/mod/mk_elfconfig
scripts/mod/.mk_elfconfig.d: done.
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
scripts/mod/.file2alias.o.d: done.
HOSTCC scripts/mod/modpost.o
scripts/mod/.modpost.o.d: done.
HOSTCC scripts/mod/sumversion.o
scripts/mod/.sumversion.o.d: done.
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
scripts/.kallsyms.d: done.
make: `arch/nios2nommu/kernel/asm-offsets.s' is up to date.
CHK include/asm-nios2nommu/asm-offsets.h
CHK include/linux/compile.h
HOSTCC usr/gen_init_cpio
usr/.gen_init_cpio.d: done.
CPIO usr/initramfs_data.cpio
GZIP usr/initramfs_data.cpio.gz
AS usr/initramfs_data.o
usr/.initramfs_data.o.d: done.
LD usr/built-in.o
CC drivers/char/spi.o
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:34: error: parse error before '*' token
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:34: warning: type defaults to `int' in declaration of `spi_ptr'
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:34: warning: initialization makes pointer from integer without a cast
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:34: warning: data definition has no type or storage class
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `SPI_Recv_Byte':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:49: error: request for member `np_spistatus' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:49: error: `np_spistatus_rrdy_mask' undeclared (first use in this function)
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:49: error: (Each undeclared identifier is reported only once
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:49: error: for each function it appears in.)
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:50: error: request for member `np_spirxdata' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `SPI_Send_Byte':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:62: error: request for member `np_spistatus' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:62: error: `np_spistatus_trdy_mask' undeclared (first use in this function)
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:63: error: request for member `np_spitxdata' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `spi_write':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:102: error: request for member `np_spistatus' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `spi_read':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:154: error: request for member `np_spistatus' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `spi_lseek':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:221: error: request for member `np_spislaveselect' in something not a structure or union
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `register_NIOS_SPI':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:272: warning: `check_region' is deprecated (declared at /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/include/linux/ioport.h:121)
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:272: error: `np_spi' undeclared (first use in this function)
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c: In function `unregister_NIOS_SPI':
/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/spi.c:288: error: `np_spi' undeclared (first use in this function)
make: *** Error 1
make: *** Error 2
make: *** Error 2
make: *** Error 2
make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x'
If i disable the SPI in the kernell configurator the kernell will build without error's Can someone help ?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nobody used SPI???? tell me if you are using it! and it working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had the same problem and IMO the SPI component generator has a bug. IIRC I corrected it and was able to compile the kernel after that. If there is no official fix for this I can post it if you want.
Marc- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes please that would be nice !
Did the SPI bus work? Do you have got a any example application? I appriciate it, if you want post it. Tnx now can i graduate at time i hope. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/rolleyes.gif- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't remember exactly what I did. I think the include file was missing some parts and the perl generator was bugged. I don't know how to add files to a post so I will just paste the code:
With this I just compiled the kernel and started uclinux but I haven't used it yet. I am supposed to play with this next week. So if you manage to make it work I would be interested to know ;-) Also if there is an official fix I'm interested too. Marc File: altera\kits\nios2\bin\eclipse\plugins\com.microtronix.nios2linux.kernel_0.1.5\linux-2.6.x\include\asm-nios2nommu\spi.h#ifndef _ASM_SPI_H_# define _ASM_SPI_H_ 1
/*--------------------------------------------------------------------
*
* include/asm-nios2nommu/spi.h
*
* Derived from various works, Alpha, ix86, M68K, Sparc, ...et al
*
* Copyright (C) 2004 Microtronix Datacom Ltd
*
* 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.
*
*
* Jan/20/2004 dgt NiosII
*
---------------------------------------------------------------------*/
# include <asm/nios.h>
int register_NIOS_SPI( void );
void unregister_NIOS_SPI( void );
# if defined(MODULE)
void cleanup_module( void );
int init_module( void );# endif
# if defined(__KERNEL__)
int spi_reset ( void );# endif
# define clockCS 0x01# define temperatureCS 0x02
# define clock_read_base 0x00# define clock_write_base 0x80# define clock_read_control 0x0F# define clock_read_trickle 0x11
# define clock_read_sec 0x00# define clock_read_min 0x01# define clock_read_hour 0x02# define clock_read_day 0x03# define clock_read_date 0x04# define clock_read_month 0x05# define clock_read_year 0x06
# define clock_write_control 0x8F# define clock_write_trickle 0x91# define clock_write_sec 0x80# define clock_write_min 0x81# define clock_write_hour 0x82# define clock_write_day 0x83# define clock_write_date 0x84# define clock_write_month 0x85# define clock_write_year 0x86
# define clock_write_ram_start 0xA0# define clock_write_ram_end 0x100# define clock_read_ram_start 0x20# define clock_read_ram_end 0x80
# define clock_sec_def 0x11# define clock_min_def 0x59# define clock_hour_def 0x71# define clock_day_def 0x00# define clock_date_def 0x20# define clock_month_def 0x12# define clock_year_def 0x34
# define temp_read_base 0x00# define temp_write_base 0x80# define temp_read_control 0x00# define temp_write_control 0x80# define temp_read_msb 0x02# define temp_read_lsb 0x01
# define MAX_TEMP_VAR 10
// SPI Registers
typedef volatile struct
{
int np_spirxdata; // Read-only, 1-16 bit
int np_spitxdata; // Write-only, same width as rxdata
int np_spistatus; // Read-only, 9-bit
int np_spicontrol; // Read/Write, 9-bit
int np_spireserved; // reserved
int np_spislaveselect; // Read/Write, 1-16 bit, master only
int np_spiendofpacket; // Read/write, same width as txdata, rxdata.
} np_spi;
// SPI Status Register Bits
enum
{
np_spistatus_eop_bit = 9,
np_spistatus_e_bit = 8,
np_spistatus_rrdy_bit = 7,
np_spistatus_trdy_bit = 6,
np_spistatus_tmt_bit = 5,
np_spistatus_toe_bit = 4,
np_spistatus_roe_bit = 3,
np_spistatus_eop_mask = (1 << 9),
np_spistatus_e_mask = (1 << 8),
np_spistatus_rrdy_mask = (1 << 7),
np_spistatus_trdy_mask = (1 << 6),
np_spistatus_tmt_mask = (1 << 5),
np_spistatus_toe_mask = (1 << 4),
np_spistatus_roe_mask = (1 << 3),
};
// SPI Control Register Bits
enum
{
np_spicontrol_sso_bit = 10,
np_spicontrol_ieop_bit = 9,
np_spicontrol_ie_bit = 8,
np_spicontrol_irrdy_bit = 7,
np_spicontrol_itrdy_bit = 6,
np_spicontrol_itoe_bit = 4,
np_spicontrol_iroe_bit = 3,
np_spicontrol_sso_mask = (1 << 10),
np_spicontrol_ieop_mask = (1 << 9),
np_spicontrol_ie_mask = (1 << 8),
np_spicontrol_irrdy_mask = (1 << 7),
np_spicontrol_itrdy_mask = (1 << 6),
np_spicontrol_itoe_mask = (1 << 4),
np_spicontrol_iroe_mask = (1 << 3),
};
// SPI Routines.
int nr_spi_rxchar(np_spi *spiBase);
int nr_spi_txchar(int i, np_spi *spiBase);
# endif /*_ASM_SPI_H_*/
File: altera\kits\nios2\bin\eclipse\plugins\com.microtronix.nios2linux.kernel_0.1.5\linux-2.6.x\arch\nios2nommu\scripts\nios2_system.h\altera_avalon_spi.pm package altera_avalon_spi;
# This module renames the first altera_avalon_spi peripheral to spi
require PTF::SystemPTF;
require PTF::SystemPTF::Module;
use strict;
sub run {
my ($system, @spi_names) = @_;
my %module_map = (
"spi" => undef,
);
my @module_map_order = ("spi");
foreach my $module_name (@module_map_order) {
my $module = $system->getModule ($module_name);
# determine availability of each module_name
if ($module) {
my $class_name = $module->getClass ();
if ($class_name ne 'altera_avalon_spi') {
print "#error The module name $module_name is of class $class_name.\n";
print "#error This will break the kernel.\n";
print "#error Please rename the module to something else in SOPC Builder.\n\n";
} else {
print "/* No translation for $module_name necessary */\n\n";
}
} else {
# if module name is available, take first uart and translate
while (scalar (@spi_names) > 0) {
my $spi_name = shift (@spi_names);
if (!exists $module_map{$spi_name}) {
my $module = $system->getModule ($spi_name);
my $result;
print "/* Redefining $spi_name -> $module_name */\n";
# start outputing necessary strings
print "#undef na_" . $spi_name . "\n";
print "#undef na_" . $spi_name . "_irq\n";
print "\n";
# base address information
$result = $module->getBaseAddress ();
printf ("#define na_%-50s %#010x\n",
($module_name, hex ($result) | 0x80000000));
# irq information
$result = $module->getIRQ ();
printf ("#define na_%-30s %30s\n",
($module_name . "_irq", $result));
print "\n";
last;
}
}
}
}
}
1;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The kernell is build witout error's
I will upload it tommorow to my board. And see if it working, but i have no appication to test it. I have not find any fix for it, maybe someone from Microtronix know it? Maybe 2 SPI interface will also work ?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page