Forum Discussion
Altera_Forum
Honored Contributor
20 years agoOpencores I2C Core and uClinux Driver
I have added an Altera Avalon SOPC Builder I2C Master component based on the Opencores I2C Host.
http://via.dynalias.org/svn/fpga/cores/i2c_master/trunk/ (http://via.dynalias.org/svn/fpga/cores/i2c_master/trunk/) Either download using the web, or use SVN to check out the project.. I simply created a wrapper for this and the necessary files to drop this component onto the Avalon bus, so I don't take any credit for this core. This will just make it easier for new people not wishing to go through this hassle. Also, I am working on getting the uClinux driver up and running. There is an Opencores driver already included in 2.6.16.1, so I will just be modifying/testing that and posting the results here. J16 Replies
- Altera_Forum
Honored Contributor
The kernel patch for 2.6.16.1 is located here:
http://via.dynalias.org/svn/uclinux/patche..._core/tags/1.0/ (http://via.dynalias.org/svn/uclinux/patches/i2c_core/tags/1.0/) This is only a simple modification of the Mictronix driver, so that it compiles with a single core. Credit goes to Microtronix for the core. - Altera_Forum
Honored Contributor
TO_BE_DONE
- Altera_Forum
Honored Contributor
It is due to kernel version changed to 2.6.17 in uClinux-dist-20060803.
I will check it tommorow. - Altera_Forum
Honored Contributor
The include file is missing.
Updated in the nios2 patch ver 10. - Altera_Forum
Honored Contributor
Hippo,
Did all that, and still get the followingmake: Entering directory `/home/uclinux/uClinux-dist/linux-2.6.x' CHK include/nios2_system.h perl -I/home/uclinux/uClinux-dist/linux-2.6.x/arch/nios2nommu/scripts /home/uclinux/uClinux-dist/linux-2.6.x/arch/nios2nommu/scripts/gen_nios2_system.h.pl cpu ddr_sdram ext_flash < /windows/downloaded/std_2C35.ptf > include/nios2_system.h.tmp; if && cmp -s include/nios2_system.h include/nios2_system.h.tmp; then rm -f include/nios2_system.h.tmp; else echo ' UPD include/nios2_system.h'; mv -f include/nios2_system.h.tmp include/nios2_system.h; fi CHK include/linux/version.h SPLIT include/linux/autoconf.h -> include/config/* CHK include/linux/compile.h CC drivers/i2c/i2c-core.o CC drivers/i2c/i2c-dev.o CC drivers/i2c/algos/i2c-algo-bit.o CC drivers/i2c/algos/i2c-algo-oc.o drivers/i2c/algos/i2c-algo-oc.c:51: error: syntax error before string constant drivers/i2c/algos/i2c-algo-oc.c:51: warning: type defaults to `int' in declaration of `MODULE_PARM' drivers/i2c/algos/i2c-algo-oc.c:51: warning: function declaration isn't a prototype drivers/i2c/algos/i2c-algo-oc.c:51: warning: data definition has no type or storage class drivers/i2c/algos/i2c-algo-oc.c:374: error: unknown field `name' specified in initializer drivers/i2c/algos/i2c-algo-oc.c:374: warning: initialization from incompatible pointer type drivers/i2c/algos/i2c-algo-oc.c:375: error: unknown field `id' specified in initializer drivers/i2c/algos/i2c-algo-oc.c:375: error: `I2C_ALGO_OC' undeclared here (not in a function) drivers/i2c/algos/i2c-algo-oc.c:375: error: initializer element is not constant drivers/i2c/algos/i2c-algo-oc.c:375: error: (near initialization for `oc_algo.smbus_xfer') drivers/i2c/algos/i2c-algo-oc.c: In function `i2c_oc_add_bus': drivers/i2c/algos/i2c-algo-oc.c:391: error: structure has no member named `id' drivers/i2c/algos/i2c-algo-oc.c:385: warning: unused variable `oc_adap' make: *** Error 1 make: *** Error 2 make: *** Error 2 make: *** Error 2 make: Leaving directory `/home/uclinux/uClinux-dist/linux-2.6.x' make: *** Error 1 uclinux@colinux:~/uClinux-dist$ - Altera_Forum
Honored Contributor
hippo,
In the customise kernel settings --> device driver --> i2c When I added i2c algorithms --> Opencores i2c interface i2c hardware bus support --> opencores i2c adapter It gives error when generating the zImage Pls help. - Altera_Forum
Honored Contributor
update again, nios2 patch ver 11.
fixup i2c for DE2. - Altera_Forum
Honored Contributor
Hippo,
Tried that, still have problems:CC drivers/i2c/algos/i2c-algo-oc.o drivers/i2c/algos/i2c-algo-oc.c:484: error: redefinition of 'i2c_debug' drivers/i2c/algos/i2c-algo-oc.c:66: error: previous definition of 'i2c_debug' was here drivers/i2c/algos/i2c-algo-oc.c:500: error: redefinition of 'i2c_start' drivers/i2c/algos/i2c-algo-oc.c:82: error: previous definition of 'i2c_start' was here drivers/i2c/algos/i2c-algo-oc.c:506: error: redefinition of 'i2c_repstart' drivers/i2c/algos/i2c-algo-oc.c:88: error: previous definition of 'i2c_repstart' was here drivers/i2c/algos/i2c-algo-oc.c:512: error: redefinition of 'i2c_stop' drivers/i2c/algos/i2c-algo-oc.c:94: error: previous definition of 'i2c_stop' was here drivers/i2c/algos/i2c-algo-oc.c:518: error: redefinition of 'wait_for_bb' drivers/i2c/algos/i2c-algo-oc.c:100: error: previous definition of 'wait_for_bb' was here drivers/i2c/algos/i2c-algo-oc.c:542: error: redefinition of 'try_address' drivers/i2c/algos/i2c-algo-oc.c:124: error: previous definition of 'try_address' was here drivers/i2c/algos/i2c-algo-oc.c:564: error: redefinition of 'oc_sendbytes' drivers/i2c/algos/i2c-algo-oc.c:146: error: previous definition of 'oc_sendbytes' was here drivers/i2c/algos/i2c-algo-oc.c:602: error: redefinition of 'oc_readbytes' drivers/i2c/algos/i2c-algo-oc.c:184: error: previous definition of 'oc_readbytes' was here drivers/i2c/algos/i2c-algo-oc.c:641: error: redefinition of 'oc_doAddress' drivers/i2c/algos/i2c-algo-oc.c:223: error: previous definition of 'oc_doAddress' was here drivers/i2c/algos/i2c-algo-oc.c:711: error: redefinition of 'oc_xfer' drivers/i2c/algos/i2c-algo-oc.c:293: error: previous definition of 'oc_xfer' was here drivers/i2c/algos/i2c-algo-oc.c:785: error: redefinition of 'oc_func' drivers/i2c/algos/i2c-algo-oc.c:367: error: previous definition of 'oc_func' was here drivers/i2c/algos/i2c-algo-oc.c:792: error: redefinition of 'oc_algo' drivers/i2c/algos/i2c-algo-oc.c:374: error: previous definition of 'oc_algo' was here drivers/i2c/algos/i2c-algo-oc.c:793: error: unknown field `name' specified in initializer drivers/i2c/algos/i2c-algo-oc.c:793: warning: initialization from incompatible pointer type drivers/i2c/algos/i2c-algo-oc.c:794: error: unknown field `id' specified in initializer drivers/i2c/algos/i2c-algo-oc.c:794: error: `I2C_ALGO_OC' undeclared here (not in a function) drivers/i2c/algos/i2c-algo-oc.c:794: error: initializer element is not constant drivers/i2c/algos/i2c-algo-oc.c:794: error: (near initialization for `oc_algo.smbus_xfer') drivers/i2c/algos/i2c-algo-oc.c:803: error: redefinition of 'i2c_oc_add_bus' drivers/i2c/algos/i2c-algo-oc.c:383: error: previous definition of 'i2c_oc_add_bus' was here drivers/i2c/algos/i2c-algo-oc.c: In function `i2c_oc_add_bus': drivers/i2c/algos/i2c-algo-oc.c:810: error: structure has no member named `id' drivers/i2c/algos/i2c-algo-oc.c:804: warning: unused variable `oc_adap' drivers/i2c/algos/i2c-algo-oc.c: At top level: drivers/i2c/algos/i2c-algo-oc.c:822: error: redefinition of 'i2c_oc_del_bus' drivers/i2c/algos/i2c-algo-oc.c:399: error: previous definition of 'i2c_oc_del_bus' was here drivers/i2c/algos/i2c-algo-oc.c:827: error: redefinition of 'i2c_algo_oc_init' drivers/i2c/algos/i2c-algo-oc.c:404: error: previous definition of 'i2c_algo_oc_init' was here drivers/i2c/algos/i2c-algo-oc.c:834: error: redefinition of 'i2c_algo_oc_exit' drivers/i2c/algos/i2c-algo-oc.c:411: error: previous definition of 'i2c_algo_oc_exit' was here drivers/i2c/algos/i2c-algo-oc.c:838: error: redefinition of '__kstrtab_i2c_oc_add_bus' drivers/i2c/algos/i2c-algo-oc.c:415: error: previous definition of '__kstrtab_i2c_oc_add_bus' was here drivers/i2c/algos/i2c-algo-oc.c:838: error: redefinition of '__ksymtab_i2c_oc_add_bus' drivers/i2c/algos/i2c-algo-oc.c:415: error: previous definition of '__ksymtab_i2c_oc_add_bus' was here drivers/i2c/algos/i2c-algo-oc.c:839: error: redefinition of '__kstrtab_i2c_oc_del_bus' drivers/i2c/algos/i2c-algo-oc.c:416: error: previous definition of '__kstrtab_i2c_oc_del_bus' was here drivers/i2c/algos/i2c-algo-oc.c:839: error: redefinition of '__ksymtab_i2c_oc_del_bus' drivers/i2c/algos/i2c-algo-oc.c:416: error: previous definition of '__ksymtab_i2c_oc_del_bus' was here drivers/i2c/algos/i2c-algo-oc.c:841: error: redefinition of '__initcall_i2c_algo_oc_init' drivers/i2c/algos/i2c-algo-oc.c:418: error: previous definition of '__initcall_i2c_algo_oc_init' was here drivers/i2c/algos/i2c-algo-oc.c:842: error: redefinition of '__exitcall_i2c_algo_oc_exit' drivers/i2c/algos/i2c-algo-oc.c:419: error: previous definition of '__exitcall_i2c_algo_oc_exit' was here make: *** Error 1 make: *** Error 2 make: *** Error 2 make: *** Error 2 make: Leaving directory `/home/uclinux/uClinux-dist/linux-2.6.x' make: *** Error 1 uclinux@colinux:~/uClinux-dist$ - Altera_Forum
Honored Contributor
I think your source is OVER patched. ?
Did you remove old patchby reverser patch ? Check "update the patches" in the UclinuxDist wiki page. Now you should remove old uCLinux-dist dir, and reinstall. - Altera_Forum
Honored Contributor
hippo, i am trying it NOW ... standby.