如题 v3s在uboot中i2c上如何挂载AXP152?有搞过的大神么,求指点,i2c probe后从设备地址为空。
=> i2c probe
Valid chip addresses:
离线
你好大神 u-boot的dts代码如下:
sun8i-v3s-licheepi-zero.dts:
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins_a>;
status = "okay";
axp152: axp152@30 {
pinctrl-names = "default";
compatible = "x-powers,axp152";
reg = <0x30>;
interrupt-parent=<&pio>;
interrupts=<1 2 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
status = "okay";
};
};
sun8i-v3s.dtsi
pio: pinctrl@01c20800 {
compatible = "allwinner,sun8i-v3s-pinctrl";
reg = <0x01c20800 0x400>;
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
clock-names = "apb", "hosc", "losc";
gpio-controller;
#gpio-cells = <3>;
interrupt-controller;
#interrupt-cells = <3>;
i2c0_pins_a: i2c0@0 {
pins = "PB6", "PB7";
function = "i2c0";
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
i2c0: i2c@01c2ac00 {
compatible = "allwinner,sun6i-a31-i2c";
reg = <0x01c2ac00 0x400>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C0>;
resets = <&ccu RST_BUS_I2C0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
确定你在 u-boot的dts正确开启了i2c ?
如果开了, 你接逻辑分析仪, 看能不能抓到数据。
离线
有,我试试
有没有逻辑分析仪?
离线
没有数据,是不是我i2c没配置好,应该怎么配置啊~求指点
确定你在 u-boot的dts正确开启了i2c ?
如果开了, 你接逻辑分析仪, 看能不能抓到数据。
离线
上拉了。我看drivers/power/Kconfig 如下
choice
prompt "Select Sunxi PMIC Variant"
depends on ARCH_SUNXI
default AXP209_POWER if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
default AXP221_POWER if MACH_SUN6I || MACH_SUN8I_A23 || MACH_SUN8I_A33
default AXP818_POWER if MACH_SUN8I_A83T
default SUNXI_NO_PMIC if MACH_SUN8I_H3 || MACH_SUN50I
config SUNXI_NO_PMIC
bool "board without a pmic"
---help---
Select this for boards which do not use a PMIC.
config AXP152_POWER
bool "axp152 pmic support"
depends on MACH_SUN5I
select CMD_POWEROFF
---help---
Select this to enable support for the axp152 pmic found on most
A10s boards.
问题是不是出在这?
小猪佩奇 说:没有数据,是不是我i2c没配置好,应该怎么配置啊~求指点
awfans 说:确定你在 u-boot的dts正确开启了i2c ?
如果开了, 你接逻辑分析仪, 看能不能抓到数据。引脚上拉了吗?
离线
没有,menuconfig默认选的是board without a pmic。
obj-$ choice
prompt "Select Sunxi PMIC Variant"
depends on ARCH_SUNXI
default AXP209_POWER if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
default AXP221_POWER if MACH_SUN6I || MACH_SUN8I_A23 || MACH_SUN8I_A33
default AXP818_POWER if MACH_SUN8I_A83T
default SUNXI_NO_PMIC if MACH_SUN8I_H3 || MACH_SUN50I
没有匹配上AXP152,我加上的话 有AXP152生成 但是编译报错
obj-$(CONFIG_AXP152_POWER) += axp152.o
axp152有生成吗?
离线
错误如下:
arch/arm/mach-sunxi/built-in.o: In function `pmic_bus_read':
/home/z/v3s/u-boot/arch/arm/mach-sunxi/pmic_bus.c:62: undefined reference to `i2c_read'
arch/arm/mach-sunxi/built-in.o: In function `pmic_bus_write':
/home/z/v3s/u-boot/arch/arm/mach-sunxi/pmic_bus.c:77: undefined reference to `i2c_write'
scripts/Makefile.spl:288: recipe for target 'spl/u-boot-spl' failed
make[1]: *** [spl/u-boot-spl] Error 1
Makefile:1319: recipe for target 'spl/u-boot-spl' failed
make: *** [spl/u-boot-spl] Error 2
感觉是我menuconfig配置问题
可以把错误贴上来
离线