Main line linux on colibri T30 to add support for mcp23s17 GPIO expander

Dear sir/madam:
Is there any tutorial to compile main line kernel for colibri T30?
What we need is to enable mcp23s17 on the SPI interface, but on your linux kernel (3.1.10) there is no dts file for T30. This is what we are doing:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output colibri_t30_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output LOADADDR=0x82008000 uImage
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output tegra30-colibri-eval-v3.dtb
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install

after that, we copy the zImage, and dtbs to the sd card (throught update.sh)… next on the u-boot prompt:

run setupdate
run update_kernel
run update_fdt

but hangs on:

reading colibri_t30/tegra30-apalis-eval-v3.dtb
25935 bytes read in 23 ms (1.1 MiB/s)

so we can’t write the dtb on the nand…

thank you very much

There seems to be an issue with the run update_fdt command, it tries to read the apalis device tree. Use the following command to fix the update_fdt environment before running run update_fdt:

setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-colibri-${fdt_board}.dtb ${filesize}'

Hi

The 3.1.10 kernel is not device tree enabled. Configuration happens in so called platform data. Please have a look here.

So to use your MCP23S17 device you would enable CONFIG_GPIO_MCP23S08 in the kernel config and add the relevant platform data (compare with mcp23s08.h).


If you want to build a mainline kernel please follow this community entry.

I just noted that there is a bug in the update scripts which tries to install the apalis device tree. This is why you’re ‘run update_fdt’ never returned.

To fix this you would update like this:

run setupdate
setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-colibri-${fdt_board}.dtb ${filesize}'
run update_kernel
run update_fdt

Max

Following the community entry as you say (with the latest stable kernel 4.7), kernel won’t boot:

Colibri T30 # boot
Booting from internal eMMC chip...
reading tegra30-colibri-eval-v3.dtb
25935 bytes read in 17 ms (1.5 MiB/s)
reading uImage
5357584 bytes read in 150 ms (34.1 MiB/s)
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Linux-4.7.0-zausan
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5357520 Bytes = 5.1 MiB
   Load Address: 08200800
   Entry Point:  08200800
   Verifying Checksum ... OK
## Flattened Device Tree blob at 82000000
   Booting using the fdt blob at 0x82000000
   Loading Kernel Image ... 

Is the addresses correct? the blog says that this is for the apalis (we don’t know if it is the same)

thank you very much

Actually we have the mcp23s17 chip working on 3.1.10 kernel

thanks!!!

Both Apalis and Colibri T30 use the same loadaddress.
However you used 08200800 while you should have used 0x82008000.
You should build the kernel like this:

 [user@host linux-stable]$ make -j6 uImage LOADADDR=0x82008000

Max