This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

保证 GPIO 口UBOOT 之后 一直不会变化



您好:

    目标 :系统实现开机 logo 的功能,直至安卓的文件系统起来。

    问题 :在UBOOT 阶段,已经参考 TI 的文档完成了 LOGO 的显示,但是发现在启动内核的一瞬间,内核会将 LCD 的 RESET 管教进行拉低,使得 LCD 被复位。使用了示波器进行跟踪,发现电平被拉低的时间,只有 20 ms。 而在代码中,也进行了跟踪 :

在 board-am335xevm.c :

MACHINE_START(AM335XEVM, "am335xevm")
/* Maintainer: Texas Instruments */
.atag_offset = 0x100,
.map_io = am335x_evm_map_io,
.init_early = am33xx_init_early,
.init_irq = ti81xx_init_irq,
.handle_irq = omap3_intc_handle_irq,
.timer = &omap3_am33xx_timer,
.init_machine = am335x_evm_init,                       // 板级初始化,跟踪这个代码
MACHINE_END

static void __init am335x_evm_init(void)
{
mdelay(100);
am33xx_cpuidle_init();

 mdelay(300);
am33xx_mux_init(board_mux);

omap_serial_init();

am335x_rtc_init(DEV_ON_BASEBOARD, PROFILE_ALL);

clkout2_enable(DEV_ON_BASEBOARD, PROFILE_ALL);

am335x_evm_id = TMPCONTROL_EVM;

// 跳过读取 EEPROM
am335x_setup_tmpcontrol_board(NULL, NULL);   // 跟踪代码,这里完成 LCD RESET 管教的初始化,并设置为高电平

}

发现,添加了延迟时间信息,LCD RESET 管教被拉低的时间 变成 420 ms,也就是说,LCD RESET 管教被拉低的阶段,是在 am335x_evm_init 之前,也就是在更早之前的板级初始化代码 :

MACHINE_START(AM335XEVM, "am335xevm")
/* Maintainer: Texas Instruments */
.atag_offset = 0x100,
.map_io = am335x_evm_map_io,
.init_early = am33xx_init_early,
.init_irq = ti81xx_init_irq,
.handle_irq = omap3_intc_handle_irq,
.timer = &omap3_am33xx_timer,
.init_machine = am335x_evm_init,
MACHINE_END

这里面的代码,看的是完全晕乎乎的。求给建议。

系统的软件部分,使用的是 TI 官方的 : processors.wiki.ti.com/.../TI-Android-JB-4.2.2-DevKit-4.1.1_DeveloperGuide

 

  • 可以测试一下

    map_io = am335x_evm_map_io,
    .init_early = am33xx_init_early,
    .init_irq = ti81xx_init_irq,
    .handle_irq = omap3_intc_handle_irq,
    .timer = &omap3_am33xx_timer,
    .init_machine = am335x_evm_init,

    是不是在这些函数里面做的

  • board-am335xevm.c 的 omap3_am33xx_timer,这个函数的定义,内核里面,我居然找不到。

  • 参考别人的帖子找到了“

    am33xx_init_early

        am33xx_hwmod_init

             omap_hwmod_register(am33xx_hwmods);

    static struct omap_hwmod am33xx_gpio1_hwmod = {
    .name = "gpio2",
    .class = &am33xx_gpio_hwmod_class,
    .clkdm_name = "l4ls_clkdm",
    .mpu_irqs = am33xx_gpio1_irqs,
    .main_clk = "gpio1_ick",
    .flags = HWMOD_INIT_NO_RESET | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
    .prcm = {
    .omap4 = {
    .clkctrl_offs = AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET,
    .modulemode = MODULEMODE_SWCTRL,
    },
    },
    .opt_clks = gpio1_opt_clks,
    .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
    .dev_attr = &gpio_dev_attr,
    .slaves = am33xx_gpio1_slaves,
    .slaves_cnt = ARRAY_SIZE(am33xx_gpio1_slaves),
    };

    也就是在 flag 中 添加 HWMOD_INIT_NO_RESET ,这样在 内核启动的时候,就不会将 IO 口进行复位