KernelDriverProgrammingCourse2015/OutlineDay2: Difference between revisions

From RevSpace
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 17: Line 17:
# Lunch Break
# Lunch Break
# Looking at a userspace interface from a userspace pov: input devices / evdev
# Looking at a userspace interface from a userspace pov: input devices / evdev
## evemu-record demo
# Looking at evdev from the kernel side
# Looking at evdev from the kernel side
## Looking at an [https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/touchscreen/chipone_icn8318.c example of an i2c input driver]
# Handson
# Handson
## Building and running your own kernel
## Building and running your own kernel
### Build and install u-boot for your board using the [[KernelDriverProgrammingCourse2015/OutlineDay1 | instructions from Day 1]]
### Build and install u-boot for your board using the [[KernelDriverProgrammingCourse2015/OutlineDay1 | instructions from Day 1]]
### Cross compile your own kernel, following the [[KernelDriverProgrammingCourse2015/PreparationDay2 preparation instructions] for today
### Cross compile your own kernel, following the [[KernelDriverProgrammingCourse2015/PreparationDay2 | preparation instructions]] for today
### Install this kernel by copying arch/arm/boot/zImage to the cards boot partition
### Install this kernel by copying arch/arm/boot/zImage to the cards boot partition
### Also copy over the build dtb files arch/arm/boot/dts/sun?i-*.dtb to the dtb dir under the boot partition
### Also copy over the build dtb files arch/arm/boot/dts/sun?i-*.dtb to the dtb dir under the boot partition
Line 29: Line 31:
### Type "make" to build the driver, and then transfer the generated .ko file to your ARM board
### Type "make" to build the driver, and then transfer the generated .ko file to your ARM board
### On your arm system do "insmod i2c-basic-drv.ko" and then "lsmod" to verify that the module has loaded
### On your arm system do "insmod i2c-basic-drv.ko" and then "lsmod" to verify that the module has loaded
## Pick a [[KernelDriverProjects | project]] and start working on it
### Any [[KernelDriverProjects | project]] from the [[KernelDriverProjects | list]] will do, basically there are 3 options to chose from:
### Projects to enable features and or complete boards in u-boot / devicetree as done during [[KernelDriverProgrammingCourse2015/OutlineDay1 | day 1]].
### Writing an i2c input device driver, as discussed today, either a [[KernelDriverProjects#Silead_GSL1680_touchcreen_driver | Silead GSL1680 touchcreen driver]], [[KernelDriverProjects#Focaltech_ft5x_touchscreen_driver | Focaltech ft5x touchscreen driver]], [[KernelDriverProjects#Memsic_MXC622X_accelerometer_driver | Memsic MXC622X accelerometer driver]], Freescale [[KernelDriverProjects#Freescale_MMA7660_accelerometer_driver | MMA7660]] or [[KernelDriverProjects#Freescale_MMA8452_accelerometer_driver | MMA8452]] accelerometer driver or a [[KernelDriverProjects#Bosch_BMA250_accelerometer_driver | Bosch BMA250 accelerometer driver]].
### Any other [[KernelDriverProjects | project]] from the [[KernelDriverProjects | list]]
Back to [[KernelDriverProgrammingCourse2015]]

Latest revision as of 09:13, 9 August 2015

Kernel Driver Programming Course Day 2

  1. Intro
    1. Welcome
    2. Results of the first course day, a number of changes have been queued up for merging into the official kernel sources
    3. Some further changes are queued up in my sunxi-wip branch as they rely on the pmic for otg vbus-detection and the matching pmic code is not yet merged upstream
  2. Plan for today:
    1. Kernel is an intermediate between hardware and applications, a device driver typically has 2 interfaces, one side talking to the hardware, and another side talking to userspace
    2. i2c hardware and driver basics
    3. Looking at a userspace interface from a userspace pov: input devices / evdev
    4. Looking at evdev from the kernel side
    5. Handson
  3. i2c hardware and driver basics
    1. i2c hardware basics
    2. Exploring an i2c device using i2cdetect and i2cget
    3. Looking at a basic i2c driver
  4. Lunch Break
  5. Looking at a userspace interface from a userspace pov: input devices / evdev
    1. evemu-record demo
  6. Looking at evdev from the kernel side
    1. Looking at an example of an i2c input driver
  7. Handson
    1. Building and running your own kernel
      1. Build and install u-boot for your board using the instructions from Day 1
      2. Cross compile your own kernel, following the preparation instructions for today
      3. Install this kernel by copying arch/arm/boot/zImage to the cards boot partition
      4. Also copy over the build dtb files arch/arm/boot/dts/sun?i-*.dtb to the dtb dir under the boot partition
      5. Boot your board, login as root and do "uname -a" to verify that the board is running your kernel
    2. Building and running a standalone driver
      1. On your laptop download the basic i2c driver, edit the Makefile adjusting the path to the linux kernel sources and CROSS_COMPILE= settings to match your system
      2. Type "make" to build the driver, and then transfer the generated .ko file to your ARM board
      3. On your arm system do "insmod i2c-basic-drv.ko" and then "lsmod" to verify that the module has loaded
    3. Pick a project and start working on it
      1. Any project from the list will do, basically there are 3 options to chose from:
      2. Projects to enable features and or complete boards in u-boot / devicetree as done during day 1.
      3. Writing an i2c input device driver, as discussed today, either a Silead GSL1680 touchcreen driver, Focaltech ft5x touchscreen driver, Memsic MXC622X accelerometer driver, Freescale MMA7660 or MMA8452 accelerometer driver or a Bosch BMA250 accelerometer driver.
      4. Any other project from the list

Back to KernelDriverProgrammingCourse2015