nand: gpmi-nand: Fix clock registration
Fabio Estevam
reviewerPATCH 1/1 nand: gpmi-nand: Fix clock registration
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit 638064e56c (mtd: gpmi: change the code for clocks):
gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1 -1
@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );if (IS_ERR (r->clock[0 ])) goto err_clock;
Signature · 1 line
1.7.9.5
Quoted 20 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct gpmi_nand_data *this) · line 495
Quoted 5 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );
Please do not change this line.
The gpmi_io is for mx6q.
If you replace it with NULL. The mx6q can not find the proper clock.
thanks
Huang Shijie
Quoted 3 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0if (IS_ERR (r->clock[0 ])) goto err_clock;
Dear Huang Shijie,
Quoted 28 lines
Quoted 27 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/mtd/nand/gpmi-nand/gpmi-nand.cindex c46be6c..1f23cb4 100644drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;/* The main clock is stored in the first. */
Quoted 7 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct gpmi_nand_data *this) · line 495
Quoted 2 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1- r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.
Suggestion is really welcome though, please :) This is a problem, GPMI NAND is broken on anything != mx6q. Huang, can you please also test the changes you do to GPMI NAND on mx28/mx23 so we can avoid this breakage in the future?
Best regards,
Marek Vasut
Fabio Estevam
reviewerQuoted 23 lines · Huang Shijie
Quoted 22 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;
Quoted 7 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct gpmi_nand_data *this) · line 495
Quoted 3 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.
What about this?
index 42978f1b..7b1aded 100644
drivers/clk/mxs/clk-imx28.c +2 -2
@@ -139,7 +139,7 @@ enum imx28_clk { ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll, emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div, clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0, - ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm, + ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm, fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out, clk_max };
@@ -208,7 +208,7 @@ int __init mx28_clocks_init(void) clks[ssp1] =mxs_clk_gate ("ssp1" ,"ssp1_div" ,SSP1 ,31 ); clks[ssp2] =mxs_clk_gate ("ssp2" ,"ssp2_div" ,SSP2 ,31 ); clks[ssp3] =mxs_clk_gate ("ssp3" ,"ssp3_div" ,SSP3 ,31 ); - clks[gpmi] =mxs_clk_gate ("gpmi" ,"gpmi_div" ,GPMI ,31 ); + clks[gpmi_io] =mxs_clk_gate ("gpmi_io" ,"gpmi_div" ,GPMI ,31 ); clks[spdif] =mxs_clk_gate ("spdif" ,"spdif_div" ,SPDIF ,31 ); clks[emi] =mxs_clk_gate ("emi" ,"emi_sel" ,EMI ,31 ); clks[saif0] =mxs_clk_gate ("saif0" ,"saif0_div" ,SAIF0 ,31 );
Can you please test it on mx28?
Regards,
Fabio Estevam
Quoted 46 lines · Fabio Estevam
Quoted 23 lines · Huang Shijie
Quoted 22 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;Quoted 7 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct gpmi_nand_data *this) · line 495
Quoted 3 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.What about this?
index 42978f1b..7b1aded 100644
drivers/clk/mxs/clk-imx28.c +1
-1@@ -139,7 +139,7 @@ enum imx28_clk { ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll, emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div, clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0, - ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm, + ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm, fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out, clk_max };
drivers/clk/mxs/clk-imx28.c int __init mx28_clocks_init(void) · line 211
Quoted 5 lines
drivers/clk/mxs/clk-imx28.c +1
-1@@ -208,7 +208,7 @@ int __init mx28_clocks_init(void) clks[ssp1] =mxs_clk_gate ("ssp1" ,"ssp1_div" ,SSP1 ,31 ); clks[ssp2] =mxs_clk_gate ("ssp2" ,"ssp2_div" ,SSP2 ,31 ); clks[ssp3] =mxs_clk_gate ("ssp3" ,"ssp3_div" ,SSP3 ,31 ); - clks[gpmi] =mxs_clk_gate ("gpmi" ,"gpmi_div" ,GPMI ,31 ); + clks[gpmi_io] =mxs_clk_gate ("gpmi_io" ,"gpmi_div" ,GPMI ,31 );
:)
This patch is really not needed.
The clk_get() can get the right clock in the mx23/mx28. I tested them.
Please read the code of clk_get().
BR
Huang Shijie
Quoted 10 lines
drivers/clk/mxs/clk-imx28.c +0
-0clks[spdif] =mxs_clk_gate ("spdif" ,"spdif_div" ,SPDIF ,31 ); clks[emi] =mxs_clk_gate ("emi" ,"emi_sel" ,EMI ,31 ); clks[saif0] =mxs_clk_gate ("saif0" ,"saif0_div" ,SAIF0 ,31 );Can you please test it on mx28?
Regards,
Fabio Estevam
Quoted 34 lines · Marek Vasut
Dear Huang Shijie,
Quoted 32 lines
Quoted 21 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/mtd/nand/gpmi-nand/gpmi-nand.cindex c46be6c..1f23cb4 100644drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct · line 498
Quoted 8 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
Quoted 5 lines
Quoted 2 lines
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.Suggestion is really welcome though, please :) This is a problem, GPMI NAND is broken on anything != mx6q. Huang, can you please also test the changes you do to GPMI NAND on mx28/mx23 so we can avoid this breakage in the future?
yes. I tested in the mx23/mx28. It's ok, do not worry.
BR
Huang Shijie
Quoted 3 lines
Best regards,
Marek Vasut
Fabio Estevam
reviewerQuoted 4 lines · Huang Shijie
This patch is really not needed.
The
clk_get()can get the right clock in the mx23/mx28. I tested them.
Please test it on linux-next.
gpmi nand can not event be probed.
Regards,
Fabio Estevam
Dear Huang Shijie,
Quoted 39 lines
Quoted 38 lines · Marek Vasut
Dear Huang Shijie,
Quoted 35 lines
Quoted 21 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam <[email protected]>---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/mtd/nand/gpmi-nand/gpmi-nand.cindex c46be6c..1f23cb4 100644drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct · line 498
Quoted 8 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.
Quoted 6 lines
Quoted 4 lines
Suggestion is really welcome though, please :) This is a problem, GPMI NAND is broken on anything != mx6q. Huang, can you please also test the changes you do to GPMI NAND on mx28/mx23 so we can avoid this breakage in the future?
yes. I tested in the mx23/mx28. It's ok, do not worry.
I won't be posting here that it's broken in the first place if it was ok ;-)
Give it one more go with latest -next ...
Best regards,
Marek Vasut
Fabio Estevam
reviewerQuoted 9 lines · Fabio Estevam
Quoted 4 lines · Huang Shijie
This patch is really not needed.
The
clk_get()can get the right clock in the mx23/mx28. I tested them.Please test it on linux-next.
gpmi nand can not event be probed.
What about this?
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0 -0
@@ -495,7 +495,11 @@ static int __devinit gpmi_get_clks(struct
gpmi_nand_data *this)
int i;
/* The main clock is stored in the first. */- r->clock[0] = clk_get(this->dev, "gpmi_io");
+ if (GPMI_IS_MX6Q(this))
+ r->clock[0] = clk_get(this->dev, "gpmi_io");
+ else
+ r->clock[0] = clk_get(this->dev, NULL);
+
if (IS_ERR(r->clock[0]))
goto err_clock;Dear Fabio Estevam,
Quoted 11 lines · Fabio Estevam
Quoted 8 lines · Huang Shijie
Quoted 3 lines
This patch is really not needed.
The
clk_get()can get the right clock in the mx23/mx28. I tested them.Please test it on linux-next.
gpmi nand can not event be probed.
What about this?
I don't like this one ... such condition shouldn't be in the driver.
Quoted 5 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0@@ -495,7 +495,11 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct · line 505
Quoted 10 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +5
-1/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); +if (GPMI_IS_MX6Q (this)) + r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); +else + r->clock[0 ] =clk_get (this->dev,NULL ); +if (IS_ERR (r->clock[0 ])) goto err_clock;
Best regards,
Marek Vasut
Quoted 7 lines · Fabio Estevam
Quoted 3 lines · Huang Shijie
This patch is really not needed.
The
clk_get()can get the right clock in the mx23/mx28. I tested them.Please test it on linux-next.
gpmi nand can not event be probed.
ok.
I will test the linux-next as soon as possible.
BR
Huang Shijie
Quoted 4 lines
Regards,
Fabio Estevam
Quoted 55 lines · Fabio Estevam
Quoted 23 lines · Huang Shijie
Quoted 22 lines · Fabio Estevam
From: Fabio Estevam<[email protected]>
On a mx28 board the following error happens since commit
638064e56c(mtd: gpmi: change the code for clocks):gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
Acquire the clock using "NULL" as it was done previously, so that the driver can register on mx23/mx28 as well.
Signed-off-by Fabio Estevam<[email protected]>--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)int i;Quoted 7 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int __devinit gpmi_get_clks(struct gpmi_nand_data *this) · line 495
Quoted 3 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1
-1/* The main clock is stored in the first. */ - r->clock[0 ] =clk_get (this->dev,"gpmi_io" ); + r->clock[0 ] =clk_get (this->dev,NULL );Please do not change this line.
The
gpmi_iois for mx6q.
If you replace it withNULL. The mx6q can not find the proper clock.What about this?
index 42978f1b..7b1aded 100644
drivers/clk/mxs/clk-imx28.c +2
-2@@ -139,7 +139,7 @@ enum imx28_clk { ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll, emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div, clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0, - ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm, + ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm, fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out, clk_max };@@ -208,7 +208,7 @@ int __init mx28_clocks_init(void) clks[ssp1] =mxs_clk_gate ("ssp1" ,"ssp1_div" ,SSP1 ,31 ); clks[ssp2] =mxs_clk_gate ("ssp2" ,"ssp2_div" ,SSP2 ,31 ); clks[ssp3] =mxs_clk_gate ("ssp3" ,"ssp3_div" ,SSP3 ,31 ); - clks[gpmi] =mxs_clk_gate ("gpmi" ,"gpmi_div" ,GPMI ,31 ); + clks[gpmi_io] =mxs_clk_gate ("gpmi_io" ,"gpmi_div" ,GPMI ,31 ); clks[spdif] =mxs_clk_gate ("spdif" ,"spdif_div" ,SPDIF ,31 ); clks[emi] =mxs_clk_gate ("emi" ,"emi_sel" ,EMI ,31 ); clks[saif0] =mxs_clk_gate ("saif0" ,"saif0_div" ,SAIF0 ,31 );
Quoted 1 line
Can you please test it on mx28?
I tested it in the linux-next with mx28-evk board. It did not works.
thanks a lot.
Huang Shijie
Quoted 4 lines
Regards,
Fabio Estevam