Possible bug in mxs-regulator

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Possible bug in mxs-regulator

ソリューションへジャンプ
1,650件の閲覧回数
lategoodbye
Senior Contributor I

I think i've found a bug in the current mxs-regulator implementation ( imx_2.6.35_maintain ).

In the file root/arch/arm/mach-mx28/power.c the mode handling is only correct for vddio. The current implementation uses bit 17 for all regulators (vddio, vdda, vddd) to get and set regulator mode. But that's wrong, according to the reference manual DISABLE_STEPPING is different for each regulator.

static int set_mode(struct mxs_regulator *sreg, int mode) { int ret = 0; u32 val; switch (mode) { case REGULATOR_MODE_FAST: val = __raw_readl(sreg->rdata->control_reg); __raw_writel(val | (1 << 17), sreg->rdata->control_reg); break; case REGULATOR_MODE_NORMAL: val = __raw_readl(sreg->rdata->control_reg); __raw_writel(val & ~(1<<17), sreg->rdata->control_reg); break; default: ret = -EINVAL; break; } return ret; } static int get_mode(struct mxs_regulator *sreg) { u32 val = __raw_readl(sreg->rdata->control_reg) & (1 << 17); return val ? REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL; }

Can anyone confirm?

ラベル(2)
タグ(4)
1 解決策
1,326件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Stefan

yes your finding is true, i.MX28 DISABLE_STEPPING bit

has different position for regulators.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,326件の閲覧回数
chrdcv
Contributor II

Hi Stefan! Thanks for the posting!

Can you explain-me how I can correct the code portion?

Thanks in advance,

Christian

0 件の賞賛
返信
1,326件の閲覧回数
lategoodbye
Senior Contributor I

Hi Christian,

for sure. Currently i'm porting the mxs-regulator for mainline. Here is the bugfix for my porting:

https://github.com/lategoodbye/mxs-regulator/commit/19ec59c871afd7666e40b4bd2209b7ede7ebf1d1

May be, you can adapt it.

Stefan

1,326件の閲覧回数
chrdcv
Contributor II

Thanks Stefan! I will try patches my files and see what happens!

Could you please see my post about troubles into the IMX287 PMU? https://community.freescale.com/thread/331410

Thanks in advance,

Christian

0 件の賞賛
返信
1,327件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Stefan

yes your finding is true, i.MX28 DISABLE_STEPPING bit

has different position for regulators.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信