Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12589 Discussions

Linux kernel patch to use FIFOed Avalon Uart

Altera_Forum
Honored Contributor II
1,117 Views

This patch is needed to generate nios2_system.h correctly when using fifoed avalon uart (http://www.niosforum.com/pages/project_details.php?p_id=89&t_id=18

 

--- ../uClinux-dist-nios2/linux-2.6.x/arch/nios2nommu/scripts/nios2_system.h/fifoed_avalon_uart.pm      1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.x/arch/nios2nommu/scripts/nios2_system.h/fifoed_avalon_uart.pm    2007-03-09 12:36:34.000000000 +0100 @@ -0,0 +1,44 @@ +package fifoed_avalon_uart; + +use base qw(BasicModule); +use strict; + +sub required_module_names { +       ("uart0", "uart1", "uart2", "uart3") +} + +sub required_class_name { +       "fifoed_avalon_uart"; +} + +sub base_address_cast { +       "np_uart" +} + +sub print_prefix { +       my ($class, $system) = @_; + +       print "#ifndef __ASSEMBLY__\n"; +       print "#include <asm/uart_struct.h>\n"; +       print "#endif\n\n"; +} + +sub translate { +       my $class = shift; +       my ($system, $required_module_name, $module_name) = @_; + +       $class->SUPER::translate (@_); + +       if (!defined ($fifoed_avalon_uart::default_uart)) { +               print "/* The default uart is always the first one found in the PTF file */\n"; +               print "#define nasys_printf_uart na_$required_module_name\n\n"; +               $fifoed_avalon_uart::default_uart = $required_module_name; +       } + +} + +sub run { +       fifoed_avalon_uart->run2 (@_); +} + +1;
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
380 Views

Great!! and Thanks a lot. 

I checked in my local svn, and will update the wiki next.
0 Kudos
Reply