The ev3dev kernel is based on Davinci PSP 03.22.00.02 from TI.
The bleeding edge upstream development for linux-davinci is hosted at kernel.org.
#Kernel Drivers Most, if not all, of the customization of the ev3dev kernel is the addition and patching of hardware drivers for the EV3 specific hardware. TODO: add more about the ev3dev device driver philosophy - particularly in regard to attributes.
Be sure to check out the hardware pages for specifics on how the drivers interface with the hardware.
##LMS2012 sources Most of the EV3 specific drivers are based on the source code for the official LEGO firmware (aka LMS2012). The following table shows the relation of ev3dev drivers to LMS2012 drivers.
lms2012 | ev3dev | Notes |
---|---|---|
d_analog.c | legoev3-analog.c | Device1 portion of d_analog.c |
ev3_input_port.c | Input portion of Device3 | |
ev3_input_port.c | Output portion of Device3 | |
d_bt.c | legoev3_bluetooth.c | d_bt.c Device1 is not implemented yet
Device2 is for firmware update, so is not needed in ev3dev "slow clock" comes from board-da850-evm.c in the lsm2012 kernel |
d_iic.c | i2c-legoev3.c | Using standard linux kernel i2c |
d_power.c | legoev3_battery.c | ev3dev power off is done in board-legoev3.c |
d_pwm.c | ev3_tacho_motor.c tacho_motor_class.c | |
d_sound.c | legoev3.c | Implemented as a ALSA sound driver for PCM playback and an input device for tone playback |
d_uart_mod.c | Using standard kernel drivers for the SoC UARTs. Ported omapl_pru from LEGO firmware for PRU UARTs. | |
d_ui.c | Using standard kernel drivers, gpio-keys for buttons and leds-gpio for LEDs | |
d_usbdev.c | Probably won't implement something like this in ev3dev Using exiting USB gadget drivers | |
d_usbhost.c | Not implementing because it does not do anything | |
Kernel | ||
board-da850-evm.c | board-legoev3.c | |
davinci-iic.c | legoev3-fiq.c | lsm2012 just uses this for i2c, ev3dev uses it for i2c and sound |
st7586fb.c | st7586fb.c |
##Where to find stuff
Drivers that implement standard kernel interfaces are located in the appropriate place in the kernel tree. Drivers that don't fit anywhere else are in drivers/legoev3/
.
$ tree -P "*legoev3*|ev3_*|nxt_*|ms_*|st7586*" -I "*.o|*.ko|*.mod.c|ms_mg.*|config|debian" --prune
.
├── arch
│ └── arm
│ └── mach-davinci
│ ├── board-legoev3.c
│ ├── board-legoev3.h
│ ├── include
│ │ └── mach
│ │ ├── legoev3-fiq.h
│ │ └── legoev3.h
│ └── legoev3-fiq.c
├── drivers
│ ├── i2c
│ │ └── busses
│ │ └── i2c-legoev3.c
│ ├── legoev3
│ │ ├── ev3_input_port.c
│ │ ├── ev3_touch_sensor.c
│ │ ├── ev3_uart_sensor.c
│ │ ├── legoev3_analog.c
│ │ ├── legoev3_bluetooth.c
│ │ ├── legoev3_ports.c
│ │ ├── legoev3_uart.c
│ │ ├── ms_light_array.c
│ │ ├── nxt_i2c_sensor.c
│ │ ├── nxt_touch_sensor.c
│ │ └── nxt_ultrasonic.c
│ ├── power
│ │ └── legoev3_battery.c
│ └── video
│ └── st7586fb.c
├── include
│ ├── linux
│ │ ├── i2c-algo-legoev3.h
│ │ ├── i2c-legoev3.h
│ │ ├── legoev3
│ │ │ ├── ev3_input_port.h
│ │ │ ├── ev3_output_port.h
│ │ │ ├── legoev3_analog.h
│ │ │ ├── legoev3_bluetooth.h
│ │ │ ├── legoev3_input_port.h
│ │ │ ├── legoev3_ports.h
│ │ │ └── nxt_i2c_sensor.h
│ │ └── power
│ │ └── legoev3_battery.h
│ ├── sound
│ │ └── legoev3.h
│ └── video
│ └── st7586fb.h
└── sound
└── pwm
├── legoev3.c
└── legoev3.h