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.

AM3352 Uboot如何开启PWM



想在uboot下开启ecap.2 PWM功能 来控制背光实现开机亮屏。

目前的做法

#define PWMSS2_BASE 0x48304000
#define PWMSS_EPWMCLK_EN BIT(8)

/* PWMSS (from arch/arm/include/asm/arch-am33xx/cpu.h) */
struct pwmss_regs {
unsigned int idver;
unsigned int sysconfig;
unsigned int clkconfig;
unsigned int clkstatus;
};

static int enable_pwm(void)
{
u16 val;
struct pwmss_regs *pwmss = (struct pwmss_regs *)PWMSS2_BASE;
printf("pwm: read ...\n");
val = readw(&pwmss->clkconfig);
printf("pwm: write ...\n");
writew(val | PWMSS_EPWMCLK_EN , &pwmss->clkconfig);
/* --- Some other stuff --- */
}

但是只能打印

pwm: read ...