Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12435 Discussions

Porting a custom Hardware device Driver from nonmmu to mmu Advice

Altera_Forum
Honored Contributor II
818 Views

Thanks in Advance. 

 

I've got a daughter card with custom hardware and my device driver that was developed on the nonmmu (nios2.h) without "probe function" that I'm updating for the mmu device tree release and a new daughter card on the DE2-115 evaluation board. 

I read and learned a bunch from http://uuoc.org/uclinux_nios2_custom_hardware.pdf 

 

My problem is that my "probe" is not getting executed so I don't have a base address or irq for the driver. But my "mod_init" does get executed if I make it a built-in module AND if I make it loadable I can to a modprobe and it is executed. 

 

My *.dts file entry for this hardware is: 

NOTE: I made up the "pcm2par" it was unknown - and my device driver matches that "pcm2par" 

 

pcm2par_av_0: unknown@0x09004c0 { 

compatible = "pcm2par, pcm2par-1.0"; 

reg = < 0x09004c0 0x00000010 >; 

interrupt-parent = < &cpu >; 

interrupts = < 8 >; 

}; // end unknown@0x09004c0 (pcm2par_av_0) 

 

 

so: 

1. do i have to use probe? can i just do all of that (of_match_device, platform_get_resource, request_mem_region, ...) in mod_init? 

2. is there a place to define custom "pcm2par" for the kernel - is "altr" defined somewhere in the nios2-linux/uclinux-dist ? 

 

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
87 Views

To answer my own question: 

 

The entry in the *.dts NEEDS TO REFER TO "ALTR" first. 

 

pcm2par_av_0: unknown@0x09004c0 { 

compatible = "ALTR, pcm2par-10.1" "ALTR, pcm2par-1.0"; 

reg = < 0x09004c0 0x00000010 >; 

interrupt-parent = < &cpu >; 

interrupts = < 8 >; 

}; // end unknown@0x09004c0 (pcm2par_av_0) 

 

Then all is well and the driver is happy.
Reply