This shows you the differences between two versions of the page.
tutorials:dvk521:documentations:a20:driver_porting_and_configuration [2013/12/10 16:42] waveshare |
tutorials:dvk521:documentations:a20:driver_porting_and_configuration [2014/03/13 14:44] (current) waveshare |
||
---|---|---|---|
Line 3: | Line 3: | ||
The I/O control driver is built as a module, can be used for controlling common peripherals, such as LED, push button, buzzer. | The I/O control driver is built as a module, can be used for controlling common peripherals, such as LED, push button, buzzer. | ||
- | Copy [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/Driver%20and%20API/driver/|io_control_dev]] to your ubuntu system, compile it with your own system setting (refer to Appendix 1 "Compiling Driver Module"), and copy the generated io_control.ko file to the board, use the following command to load the driver module: | + | Copy [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/Driver%20and%20API/driver/|io_control_dev]] to your ubuntu system, compile it with your own system setting (refer to Appendix 1 "Compiling Driver Module"), and copy the generated io_control.ko file to the board, use the following command to load the driver module: |
$insmod io_control.ko | $insmod io_control.ko | ||
Now you can start to try the I/O control API demo (refer to Appendix 2 "Running API Demo"). | Now you can start to try the I/O control API demo (refer to Appendix 2 "Running API Demo"). | ||
Line 41: | Line 41: | ||
Reboot the system, insert the DS18B20 device. | Reboot the system, insert the DS18B20 device. | ||
- | Copy [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/Driver%20and%20API/driver/|ds18b20l_dev]] to your ubuntu system, compile it with your own system setting (refer to Appendix 1 "Compiling Driver Module"), and copy the generated w1-sun4i.ko file to the board, use the following command to load the driver: | + | Copy [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/Driver%20and%20API/driver/|ds18b20_dev]] to your ubuntu system, compile it with your own system setting (refer to Appendix 1 "Compiling Driver Module"), and copy the generated w1-sun4i.ko file to the board, use the following command to load the driver: |
$insmod w1-sun4i.ko | $insmod w1-sun4i.ko | ||
Line 49: | Line 49: | ||
{{..:Documentations-6_1.jpg}} | {{..:Documentations-6_1.jpg}} | ||
+ | |||
==== Porting I2C Bus Driver ==== | ==== Porting I2C Bus Driver ==== | ||
Line 74: | 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:A10: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: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:A10: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:DVK521:Documentations:A20:DVK521 User Manual|DVK521 User Manual]] and Appendix 2 "Running API Demo". |
Line 93: | Line 94: | ||
help | help | ||
Allwinner Soc SPI controller,present on SUN7I chips. | Allwinner Soc SPI controller,present on SUN7I chips. | ||
+ | |||
config SUN7I_SPI_NDMA | config SUN7I_SPI_NDMA | ||
bool "SUN7I SPI Normal DMA mode select" | bool "SUN7I SPI Normal DMA mode select" | ||
Line 291: | Line 293: | ||
=== Config the script.fex === | === Config the script.fex === | ||
Since the touch screen is connected to I2C1 controller, make sure the I2C driver has been ported (refer to the previous section "Porting I2C Bus Driver"). | Since the touch screen is connected to I2C1 controller, make sure the I2C driver has been ported (refer to the previous section "Porting I2C Bus Driver"). | ||
- | Config the [ctp_para] setting in script.fex. | + | Config the [ctp_para],[ctp_list_para],and[gpio_para] setting in script.fex. |
ctp_name:driver name | ctp_name:driver name | ||
ctp_twi_id:I2C controller which is actually used | ctp_twi_id:I2C controller which is actually used | ||
Line 317: | Line 319: | ||
ctp_firm = 1 | ctp_firm = 1 | ||
ctp_wakeup = port:PB13<1><default><default><1> | ctp_wakeup = port:PB13<1><default><default><1> | ||
+ | | ||
+ | [ctp_list_para] | ||
+ | ctp_det_used = 1 | ||
+ | ft5x_ts = 1 | ||
+ | gt82x = 0 | ||
+ | gslX680 = 0 | ||
+ | gt9xx_ts = 0 | ||
+ | gt811 = 0 | ||
| | ||
[gpio_para] | [gpio_para] | ||
Line 442: | Line 452: | ||
sun4i_csi1.ko: | sun4i_csi1.ko: | ||
/lib/modules/3.4.61+/kernel/drivers/media/video/sun4i_csi/csi1 | /lib/modules/3.4.61+/kernel/drivers/media/video/sun4i_csi/csi1 | ||
- | 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:A10: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:DVK521:Documentations:A20:Prepare for Kernel and Drivers Porting|Prepare for Kernel and Drivers Porting]] |
Copy the above 4 driver files to the board, and install them in order: | Copy the above 4 driver files to the board, and install them in order: | ||
Line 562: | Line 572: | ||
==== Appendix 1: Compiling Driver Module ==== | ==== Appendix 1: Compiling Driver Module ==== | ||
- | The provided xx.ko files under [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/Driver%20and%20API/driver/|Driver]] is compiled to run on our system image only. | + | The provided xx.ko files under [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/Driver%20and%20API/driver/|Driver]] is compiled to run on our system image only. |
If the drivers are going to being loaded on your own system, they need to be re-compiled according to you system kernel path. | If the drivers are going to being loaded on your own system, they need to be re-compiled according to you system kernel path. | ||
Line 568: | Line 578: | ||
Use the io_control_dev.ko for demonstration. | Use the io_control_dev.ko for demonstration. | ||
- | 1.1 Copy the [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/A20/Driver%20and%20API/driver/|io_control_dev]] to ubuntu, assume the target directory is /home/waveshare/cubieboard2/waveshare_demo/driver . | + | 1.1 Copy the [[http://dl.cubieboard.org/parteners/waveshare/Source_Code/a20-cubieboard-dvk/Driver%20and%20API/driver/|io_control_dev]] to ubuntu, assume the target directory is /home/waveshare/cubieboard2/waveshare_demo/driver . |
Modify the files permission: | Modify the files permission: | ||
#cd /home/waveshare/cubieboard2/waveshare_demo/driver/io_control_dev | #cd /home/waveshare/cubieboard2/waveshare_demo/driver/io_control_dev | ||
Line 597: | Line 607: | ||
It is caused by the different kernel version, can be just omitted. | It is caused by the different kernel version, can be just omitted. | ||
{{:tutorials:dvk521:documentations:a20:a20_6_5.jpg}} | {{:tutorials:dvk521:documentations:a20:a20_6_5.jpg}} | ||
+ | |||
Copy the new generated io_control.ko file to your own system and load it. | Copy the new generated io_control.ko file to your own system and load it. | ||