This shows you the differences between two versions of the page.
tutorials:expansion_boards_dvk:dvk521:documentations:a20:driver_porting_and_configuration [2014/06/28 15:14] waveshare created |
tutorials:expansion_boards_dvk:dvk521:documentations:a20:driver_porting_and_configuration [2014/07/23 11:12] (current) waveshare |
||
---|---|---|---|
Line 10: | Line 10: | ||
[lcd0_para] | [lcd0_para] | ||
lcd_gpio_0 = port:PH15<0><0><default><default> | lcd_gpio_0 = port:PH15<0><0><default><default> | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Reboot the system to apply new configuration. | Reboot the system to apply new configuration. | ||
Line 31: | Line 31: | ||
Save and exit, re-compile the kernel: | Save and exit, re-compile the kernel: | ||
#make uImage | #make uImage | ||
- | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
=== Config the script.fex === | === Config the script.fex === | ||
Config the script.fex as follows, add the [w1_para] setting: | Config the script.fex as follows, add the [w1_para] setting: | ||
Line 37: | Line 37: | ||
w1_used = 1 | w1_used = 1 | ||
w1_pin = port:PB10<1><default><default><default> | w1_pin = port:PB10<1><default><default><default> | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Reboot the system, insert the DS18B20 device. | Reboot the system, insert the DS18B20 device. | ||
Line 48: | Line 48: | ||
As shown in the picture below: | As shown in the picture below: | ||
- | {{..:Documentations-6_1.jpg}} | + | {{:tutorials:expansion_boards_dvk:dvk521:documentations:a20:documentations-6_1.jpg}} |
Line 75: | Line 75: | ||
twi1_scl = port:PB18<2><default><default><default> | twi1_scl = port:PB18<2><default><default><default> | ||
twi1_sda = port:PB19<2><default><default><default> | twi1_sda = port:PB19<2><default><default><default> | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Reboot the system. | Reboot the system. | ||
- | For more info about testing the AT24/FM24 module, like reading/writing data, please refer to the document [[tutorials:DVK521:Documentations:A20:DVK521 User Manual|DVK521 User Manual]] and Appendix 2 "Running API Demo". | + | For more info about testing the AT24/FM24 module, like reading/writing data, please refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/dvk521_user_manual|DVK521 User Manual]] and Appendix 2 "Running API Demo". |
==== Porting SPI Devices Driver ==== | ==== Porting SPI Devices Driver ==== | ||
=== Config the Kernel === | === Config the Kernel === | ||
- | The A20 SPI is not natively supported by linux-sunxi-sunxi-3.4.61 kernel. You should copy the spi-sun7i.c file [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/driver%20source|spi-sun7i.c]] to the drivers/spi directory in the kernel, and modify the related Makefile and Kconfig under the same directory. | + | The A20 SPI is not natively supported by linux-sunxi-sunxi-3.4.61 kernel. You should copy the spi-sun7i.c file [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/driver%20source/|spi-sun7i.c]] to the drivers/spi directory in the kernel, and modify the related Makefile and Kconfig under the same directory. |
Add the following line in Makefile: | Add the following line in Makefile: | ||
Line 111: | Line 111: | ||
Save and exit, re-compile the kernel: | Save and exit, re-compile the kernel: | ||
#make uImage | #make uImage | ||
- | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
=== Config the script.fex === | === Config the script.fex === | ||
Line 135: | Line 135: | ||
full_duplex = 0 | full_duplex = 0 | ||
manual_cs = 0 | manual_cs = 0 | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Now the kernel and script.fex configuration for SPI device have completed, the last step is to load the io_control.ko driver module (refer to the previous section " Porting I/O Control Driver"). | Now the kernel and script.fex configuration for SPI device have completed, the last step is to load the io_control.ko driver module (refer to the previous section " Porting I/O Control Driver"). | ||
Line 159: | Line 159: | ||
Save and exit, re-compile the kernel: | Save and exit, re-compile the kernel: | ||
#make uImage | #make uImage | ||
- | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
=== Config the script.fex === | === Config the script.fex === | ||
Line 274: | Line 274: | ||
==== Porting CTP Driver ==== | ==== Porting CTP Driver ==== | ||
=== Config the Kernel === | === Config the Kernel === | ||
- | Our capacitive touch screen integrates FT5206 as the touch controller, and the related driver file is ft5x_ts.c. Unfortunately the original ft5x_ts.c in linux-sunxi-sunxi-3.4.61 kernel doesn’t support A20, therefore, copy the new ft5x_ts.c [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/driver%20source/|ft5x_ts.c]] to the drivers/input/touchscreen directory in kernel and replace the original one. Besides, the touch screen interrupt pin ctp_int_port requires GPIO interrupts, make sure the GPIO driver is included when configuring. | + | Our capacitive touch screen integrates FT5206 as the touch controller, and the related driver file is ft5x_ts.c. Unfortunately the original ft5x_ts.c in linux-sunxi-sunxi-3.4.61 kernel doesn’t support A20, therefore, copy the new ft5x_ts.c [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/driver%20source//|ft5x_ts.c]] to the drivers/input/touchscreen directory in kernel and replace the original one. Besides, the touch screen interrupt pin ctp_int_port requires GPIO interrupts, make sure the GPIO driver is included when configuring. |
Config the Kernel to include touchscreen driver: | Config the Kernel to include touchscreen driver: | ||
Line 289: | Line 289: | ||
Re-compile the kernel: | Re-compile the kernel: | ||
#make uImage | #make uImage | ||
- | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Replace the earlier uImage on the board with the new generated uImage under arch/arm/boot/ directory via NFS. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
=== Config the script.fex === | === Config the script.fex === | ||
Line 331: | Line 331: | ||
gpio_pin_3 = port:PH07<6><default><default><default> | gpio_pin_3 = port:PH07<6><default><default><default> | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Connect the 7inch capacitive LCD, reboot the system, try to touch the icons on the screen. | Connect the 7inch capacitive LCD, reboot the system, try to touch the icons on the screen. | ||
Line 565: | Line 565: | ||
gc2035 = 0 | gc2035 = 0 | ||
- | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] | + | Then convert it into script.bin format by using fex2bin, and replace the earlier script.bin on the board. (for more info, refer to the document [[tutorials/expansion_boards_dvk/dvk521/documentations/a20/prepare_for_kernel_and_drivers_porting|Prepare for Kernel and Drivers Porting]] |
Connect the OV7670 camera module and the LCD to the board, reboot the system. | Connect the OV7670 camera module and the LCD to the board, reboot the system. |