How to use SPI slave within U-Boot?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to use SPI slave within U-Boot?

跳至解决方案
4,972 次查看
chris_f
Contributor V

I'm trying to initialise an LCD over SPI within U-Boot on an i.MX6ULLEVK. Can someone point me at some relevant U-Boot examples of setting up and using an SPI slave?

标记 (3)
0 项奖励
回复
1 解答
3,412 次查看
chris_f
Contributor V

It's fairly simple once you find the file you need to edit! If like me you're new to Yocto then that in itself is a challenge. As far as I can make out, all of the u-boot board specific code for the i.MX6ULLEVK is in:

build/tmp/work/imx6ull14x14evk-poky-linux-gnueabi/u-boot-imx/2016.03-r0/git/board/freescale/mx6ullevk/mx6ullevk.c


I couldn't find any helpful spi libraries in the u-boot code - I think there might be some there but even the int enable_spi_clk(unsigned char enable, unsigned spi_num); failed to link with object not found so I figured I was on my own with the reference manual.

The attached patch adds a hacked in spi lcd initialisation (note the LCD in question uses 9-bit transfers) to the do_enable_parallel_lcd function.

If you're using an i.MX6ULBB you'll also need to remove resistors R1633 (hidden next to the SOM), R1634, R1635 and R1636 (all hidden on the back of the board) and fit 0R in R907,R908,R910 and R911 (hidden next to R1633).

在原帖中查看解决方案

2 回复数
3,413 次查看
chris_f
Contributor V

It's fairly simple once you find the file you need to edit! If like me you're new to Yocto then that in itself is a challenge. As far as I can make out, all of the u-boot board specific code for the i.MX6ULLEVK is in:

build/tmp/work/imx6ull14x14evk-poky-linux-gnueabi/u-boot-imx/2016.03-r0/git/board/freescale/mx6ullevk/mx6ullevk.c


I couldn't find any helpful spi libraries in the u-boot code - I think there might be some there but even the int enable_spi_clk(unsigned char enable, unsigned spi_num); failed to link with object not found so I figured I was on my own with the reference manual.

The attached patch adds a hacked in spi lcd initialisation (note the LCD in question uses 9-bit transfers) to the do_enable_parallel_lcd function.

If you're using an i.MX6ULBB you'll also need to remove resistors R1633 (hidden next to the SOM), R1634, R1635 and R1636 (all hidden on the back of the board) and fit 0R in R907,R908,R910 and R911 (hidden next to R1633).

3,412 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Chris,

Thanks for sharing your solution with the Community! As you mentioned, SPI driver is already included on the U-boot sources, so, you need to modify it according to your application requirements.

Best regards!

/Carlos

0 项奖励
回复