完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
1.实验原理
FS-MP1A开发板蓝牙采用AP6236,WIFI蓝牙二合一芯片。WiFi部分通过SDIO接口与SoC进行数据交互。 在FS-MP1A开发板上sdmmc1用于连接sdcard,sdmmc2用于连接eMMC,sdmmc3则用于连接我们这里所用到的AP6236的WiFi接口。 sdmmc3的设备树配置可参考stm32mp157c-dk2.dts中的相关配置,需要重新调整sdmmc3所使用的管脚,AP_CK32KO管脚配置和BT_WIFI_RST管脚配置。 查看原理图得出AP6236数据管脚与STM32MP157A的管脚对应关系如下:
参考文档: Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt Documentation/devicetree/bindings/mmc/mmc.txt 内核中ST对STM32MP15x系列芯片的设备树资源了做了定义,可参见: arch/arm/boot/dts/stm32mp151.dtsi stm32mp151中sdmmc3定义如下: sdmmc3: sdmmc@48004000 { compatible = "arm,pl18x", "arm,primecell"; arm,primecell-periphid = <0x00253180>; reg = <0x48004000 0x400>, <0x48005000 0x400>; interrupts = interrupt-names = "cmd_irq"; clocks = <&rcc SDMMC3_K>; clock-names = "apb_pclk"; resets = <&rcc SDMMC3_R>; cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <120000000>; status = "disabled"; }; 上述代码只对sdmmc3做了基本的初始化,并没有针对不同的硬件设计做适配,所以需结合硬件补全设备树节点信息。 参考文档或stm32mp157c-dk2.dts对于sdmmc2设备节点的描述,增加sdmmc3内容如下: &sdmmc3 { arm,primecell-periphid = <0x10153180>; pinctrl-names = "default", "opendrain", "sleep"; pinctrl-0 = <&sdmmc3_b4_wifi_pins_a>; pinctrl-1 = <&sdmmc3_b4_od_wifi_pins_a>; pinctrl-2 = <&sdmmc3_b4_sleep_wifi_pins_a>; non-removable; st,neg-edge; bus-width = <4>; vmmc-supply = <&v3v3>; mmc-pwrseq = <&wifi_pwrseq>; #address-cells = <1>; #size-cells = <0>; keep-power-in-suspend; status = "okay"; brcmf: bcrmf@1 { reg = <1>; compatible = "brcm,bcm4329-fmac"; }; }; 这里用到了一个mmc-pwrseq管脚用于控制AP6236的电源,可以stm32mp157c-dk2.dts对于wifi_pwrseq设备节点的描述,增加wifi_pwrseq内容如下: wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&gpiod 4 GPIO_ACTIVE_LOW>; }; stm32mp15-pinctrl.dtsi对于sdmmc3的描述与FS-MP1A所使用管脚不一致,所以无法直接使用,需参考其增加如下内容: sdmmc3_b4_wifi_pins_a: sdmmc3-b4-wifi-0 { pins1 { pinmux = slew-rate = <1>; drive-push-pull; bias-pull-up; }; pins2 { pinmux = slew-rate = <2>; drive-push-pull; bias-pull-up; }; }; sdmmc3_b4_od_wifi_pins_a: sdmmc3-b4-od-wifi-0 { pins1 { pinmux = slew-rate = <1>; drive-push-pull; bias-pull-up; }; pins2 { pinmux = slew-rate = <2>; drive-push-pull; bias-pull-up; }; pins3 { pinmux = slew-rate = <1>; drive-open-drain; bias-pull-up; }; }; sdmmc3_b4_sleep_wifi_pins_a: sdmmc3-b4-sleep-wifi-0 { pins { pinmux = }; };
AP6236需要使用一个外部输入的32.768KHz的时钟源,因此我们需要使能RTC的外部32.768KHz功能 参考文档: Documentation/devicetree/bindings/rtc/st,stm32-rtc.txt 内核中ST对STM32MP15x系列芯片的设备树资源了做了定义,可参见: arch/arm/boot/dts/stm32mp151.dtsi stm32mp151中rtc定义如下: rtc: rtc@5c004000 { compatible = "st,stm32mp1-rtc"; reg = <0x5c004000 0x400>; clocks = <&scmi0_clk CK_SCMI0_RTCAPB>, <&scmi0_clk CK_SCMI0_RTC>; clock-names = "pclk", "rtc_ck"; interrupts-extended = <&exti 19 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; 上述代码只对rtc做了基本的初始化,并没有针对不同的硬件设计做适配,所以需结合硬件补全设备树节点信息。 参考stm32mp157c-dk2.dts对于rtc设备节点的描述,需增加内容如下: rtc { st,lsco = pinctrl-0 = <&rtc_out2_rmp_pins_a>; pinctrl-names = "default"; status = "okay"; }; 2.实验目的 熟悉基于Linux操作系统下的WiFi设备驱动移植配置过程。 3.实验平台 华清远见开发环境,FS-MP1A平台; 4.实验步骤
linux@ubuntu:$ source /opt/st/stm32mp1/3.1-openstlinux-5.4-dunfell-mp1-20-06-24/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi 由于WiFi部分与蓝牙部分共用1路RTC时钟,有些操作与蓝牙要修改的内容相同,因此如果之前已经做过了蓝牙的移植,则这些部分不需要再重复修改。
修改arch/arm/dts/stm32mp15xx-fsmp1x.dtsi文件,在文件末尾添加如下内容: &sdmmc3 { arm,primecell-periphid = <0x10153180>; pinctrl-names = "default", "opendrain", "sleep"; pinctrl-0 = <&sdmmc3_b4_wifi_pins_a>; pinctrl-1 = <&sdmmc3_b4_od_wifi_pins_a>; pinctrl-2 = <&sdmmc3_b4_sleep_wifi_pins_a>; non-removable; st,neg-edge; bus-width = <4>; vmmc-supply = <&v3v3>; mmc-pwrseq = <&wifi_pwrseq>; #address-cells = <1>; #size-cells = <0>; keep-power-in-suspend; status = "okay"; brcmf: bcrmf@1 { reg = <1>; compatible = "brcm,bcm4329-fmac"; }; };
修改arch/arm/dts/stm32mp15xx-fsmp1x.dtsi文件,在根节点末尾下添加如下内容: wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&gpiod 4 GPIO_ACTIVE_LOW>; };
要添加管脚配置需要有pinctrl节点,如果之前已经做了MIPI LCD移植或者RGB LCD则在arch/arm/boot/dts/stm32mp15xx-fsmp1x.dtsi文件下找到pinctrl节点添加如下配置,如果之前没有做MIPI LCD移植或者RGB LCD那么需要新建一个pinctrl节点,然后添加如下配置。 &pinctrl { ... ... sdmmc3_b4_wifi_pins_a: sdmmc3-b4-wifi-0 { pins1 { pinmux = slew-rate = <1>; drive-push-pull; bias-pull-up; }; pins2 { pinmux = slew-rate = <2>; drive-push-pull; bias-pull-up; }; }; sdmmc3_b4_od_wifi_pins_a: sdmmc3-b4-od-wifi-0 { pins1 { pinmux = slew-rate = <1>; drive-push-pull; bias-pull-up; }; pins2 { pinmux = slew-rate = <2>; drive-push-pull; bias-pull-up; }; pins3 { pinmux = slew-rate = <1>; drive-open-drain; bias-pull-up; }; }; sdmmc3_b4_sleep_wifi_pins_a: sdmmc3-b4-sleep-wifi-0 { pins { pinmux = }; }; ... ... };
如果之前已经做过了蓝牙的移植,则这部分不需要再重复修改。 修改arch/arm/dts/stm32mp15xx-fsmp1x.dtsi文件中的rtc节点添加如下内容: rtc { st,lsco = pinctrl-0 = <&rtc_out2_rmp_pins_a>; pinctrl-names = "default"; status = "okay"; }; 其中红色字体部分为要添加的内容。 添加rtc相关头文件。如果之前已经做过了蓝牙的移植,则这部分不需要再重复修改。 #include
在系统中加入了sdmmc3的配置选项,导致系统中eMMC的设备号发生了改变,系统在启动过程中找不到原来的eMMC设备会导致启动失败。我们可以通过修改ubuntu主机中的/tftpboot/pxelinux.cfg/01-00-80-e1-42-60-17文件配置来解决这个问题。 # Generic Distro Configuration file generated by OpenEmbedded menu title Select the boot mode MENU BACKGROUND /splash.bmp TIMEOUT 20 DEFAULT stm32mp157a-fsmp1a-emmc LABEL stm32mp157a-fsmp1a-emmc KERNEL /uImage FDT /stm32mp157a-fsmp1a.dtb APPEND root=/dev/mmcblk2p4 rootwait rw console=ttySTM0,115200 LABEL stm32mp157a-fsmp1a-mipi050-emmc KERNEL /uImage FDT /stm32mp157a-fsmp1a-mipi050.dtb APPEND root=/dev/mmcblk2p4 rootwait rw console=ttySTM0,115200 LABEL stm32mp157a-fsmp1a-rgb070-emmc KERNEL /uImage FDT /stm32mp157a-fsmp1a-rgb070.dtb APPEND root=/dev/mmcblk2p4 rootwait rw console=ttySTM0,115200
由于内核源码默认配置以及支持AP62xx,本节列出主要选项,如下: linux@ubuntu:$ make menuconfig Device Drivers ---> <*> Broadcom specific AMBA --->
|
|||
|
|||
只有小组成员才能发言,加入小组>>
3263 浏览 9 评论
2944 浏览 16 评论
3443 浏览 1 评论
8955 浏览 16 评论
4036 浏览 18 评论
1079浏览 3评论
559浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
552浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2287浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1848浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-10 18:12 , Processed in 1.174570 second(s), Total 78, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号