Firefly开源社区

rk3288 uboot解析act8846 dts

55

积分

0

威望

0

贡献

技术小白

积分
55
发表于 2018-12-19 11:41:52     
rk3288 uboot act8846初始化的时候解析act8846的DTS,但是在uboot(u-boot/arch/arm/dts)的目录中没有搜索rk3288的DTS文件,请问uboot解析的dts文件在哪个目录

static int act8846_parse_dt(const void* blob)
{
        int node, nd;
        struct fdt_gpio_state gpios[2];
        u32 bus, addr;
        int ret, i;
                printf("act8846_parse_dt \r\n");
        node = fdt_node_offset_by_compatible(blob,
                                        g_i2c_node, COMPAT_ACTIVE_ACT8846);
        if (node < 0) {
               
                        printf("can't find dts node for act8846\n\r\n");
                debug("can't find dts node for act8846\n");
                return -ENODEV;
        }
printf("act8846_parse_dt step1  \r\n");
        if (!fdt_device_is_available(blob, node)) {
                debug("device act8846 is disabled\n");
                return -1;
        }

        ret = fdt_get_i2c_info(blob, node, &bus, &addr);
        if (ret < 0) {
                debug("pmic act8846 get fdt i2c failed\n");
                return ret;
        }

        ret = act8846_i2c_probe(bus, addr);
        if (ret < 0) {
                debug("pmic act8846 i2c probe failed\n");
                return ret;
        }
       
        nd = fdt_get_regulator_node(blob, node);
        if (nd < 0)
                printf("%s: Cannot find regulators\n", __func__);
        else
                fdt_regulator_match(blob, nd, act8846_reg_matches,
                                        ACT8846_NUM_REGULATORS);

        for (i = 0; i < ACT8846_NUM_REGULATORS; i++)
                regulator_init_pmic_matches[i].name = act8846_reg_matches[i].name;

        fdtdec_decode_gpios(blob, node, "gpios", gpios, 2);

        act8846.pmic = pmic_alloc();
        act8846.node = node;
        act8846.pmic->hw.i2c.addr = addr;
        act8846.pmic->bus = bus;
        act8846.pwr_hold.gpio = gpios[1].gpio;
        act8846.pwr_hold.flags = !(gpios[1].flags  & OF_GPIO_ACTIVE_LOW);

        return 0;
}
回复

使用道具 举报

3746

积分

17

威望

18

贡献

官方团队

Rank: 9Rank: 9Rank: 9

积分
3746
发表于 2018-12-24 14:36:30     
uboot里面调用的dts,最终是在resource.img读取,这个文件是在内核编译生成的,
也就是说,dts生成的resource.img被uboot和kernel使用
回复

使用道具 举报

55

积分

0

威望

0

贡献

技术小白

积分
55
发表于 2018-12-28 10:12:54     
jpchen 发表于 2018-12-24 14:36
uboot里面调用的dts,最终是在resource.img读取,这个文件是在内核编译生成的,
也就是说,dts生成的resou ...

您的意思是,uboot启动的时候会去解析reource.img获得设备树的信息?
回复

使用道具 举报

3746

积分

17

威望

18

贡献

官方团队

Rank: 9Rank: 9Rank: 9

积分
3746
发表于 2018-12-29 09:19:28     
1210443832 发表于 2018-12-28 10:12
您的意思是,uboot启动的时候会去解析reource.img获得设备树的信息?

是的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表