Difference between revisions of "KernelDriverProgrammingCourse2015/OutlineDay1"

From RevSpace
Jump to navigation Jump to search
(Created page with "== Kernel Driver Programming Course Day 1 == # Intro ## Welcome ## I'm going to dump a lot of information on you, don't worry you do not need to remember it all :) ## Quick...")
 
(Kernel Driver Programming Course Day 1)
Line 12: Line 12:
 
# dts file example for a simple board
 
# dts file example for a simple board
 
##  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts | sun4i-a10-mini-xplus.dts]
 
##  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts | sun4i-a10-mini-xplus.dts]
# Hands on 1        
+
# Hands on 1: Build and install u-boot and a dts file and boot the board
## Everyone gets a board
+
## Everyone gets a board, a usb to serial convertor and a sdcard
 
## Build and install u-boot:
 
## Build and install u-boot:
 
### Figure out the config to use for your board, do:<br/> cd u-boot<br/> grep -l SUNXI configs/*_defconfig
 
### Figure out the config to use for your board, do:<br/> cd u-boot<br/> grep -l SUNXI configs/*_defconfig
 
### Build u-boot for your board, do:<br/> make -j4 CROSS_COMPILE=arm-linux-gnu- $foo_defconfig<br/>  make -j4 CROSS_COMPILE=arm-linux-gnu-
 
### Build u-boot for your board, do:<br/> make -j4 CROSS_COMPILE=arm-linux-gnu- $foo_defconfig<br/>  make -j4 CROSS_COMPILE=arm-linux-gnu-
 +
### Insert the provided sdcard into your laptop
 +
### Figure out which blockdev it has been given, do:<br/> dmesg | tail
 +
### Install u-boot by dd-ing it to the whole device (not a partition) blockdev, e.g.:<br/> sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8
 +
## Boot the board:
 +
### Plug a usb to serial convertor into your laptop
 +
### Figure out which ttyUSB# it has been given, do:<br/> dmesg | tail
 +
### Start screen on the ttyUSB# in question, e.g.:<br/> screen /dev/ttyUSB0 115200
 +
### Power up the board, and check that it boots properly in the screen session
 +
# Adding support for the musb otg controller to a sunxi dts file
 +
## See [https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/for-next&id=d7a99f6bb625e7d0a256bc6e3d4538669ea22f27 the commit] enalbing it on the A20 OLinuxino Lime as an example of the necessary changes
 +
## See the A20 OLinuxino Lime [https://github.com/OLIMEX/OLINUXINO/raw/master/HARDWARE/A10-OLinuXino-LIME/A10-OLinuXino-Lime_Rev_C.pdf schematic] as an example how to figure out which gpios to use for vbus_det / id_det. Or alternatively look at the [https://github.com/linux-sunxi/sunxi-boards/blob/master/sys_config/a20/a20-olinuxino_lime.fex fex file] for the board.

Revision as of 16:56, 25 July 2015

Kernel Driver Programming Course Day 1

  1. Intro
    1. Welcome
    2. I'm going to dump a lot of information on you, don't worry you do not need to remember it all :)
    3. Quickly explain of different Axx models
    4. A10 Datasheet Block diagram (page 12), give a quick overview of the A10
  2. A10 SoC dtsi file (example)
    1. sun4i-a10.dtsi
    2. For a list of addresses see the A10 user manual, section 3.2 "Memory mapping", and 11.2 "Interrupt Source"
    3. For clock tree info see: A10 Datasheet Clock tree diagram (pages 51 - 54)
  3. dts file example for a simple board
    1. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts | sun4i-a10-mini-xplus.dts]
  4. Hands on 1: Build and install u-boot and a dts file and boot the board
    1. Everyone gets a board, a usb to serial convertor and a sdcard
    2. Build and install u-boot:
      1. Figure out the config to use for your board, do:
        cd u-boot
        grep -l SUNXI configs/*_defconfig
      2. Build u-boot for your board, do:
        make -j4 CROSS_COMPILE=arm-linux-gnu- $foo_defconfig
        make -j4 CROSS_COMPILE=arm-linux-gnu-
      3. Insert the provided sdcard into your laptop
      4. Figure out which blockdev it has been given, do:
        dmesg | tail
      5. Install u-boot by dd-ing it to the whole device (not a partition) blockdev, e.g.:
        sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8
    3. Boot the board:
      1. Plug a usb to serial convertor into your laptop
      2. Figure out which ttyUSB# it has been given, do:
        dmesg | tail
      3. Start screen on the ttyUSB# in question, e.g.:
        screen /dev/ttyUSB0 115200
      4. Power up the board, and check that it boots properly in the screen session
  5. Adding support for the musb otg controller to a sunxi dts file
    1. See the commit enalbing it on the A20 OLinuxino Lime as an example of the necessary changes
    2. See the A20 OLinuxino Lime schematic as an example how to figure out which gpios to use for vbus_det / id_det. Or alternatively look at the fex file for the board.