* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 5:40 ` Shawn Guo
2011-12-12 3:42 ` [PATCH 2/7] arm/imx: cpufreq: add multi-core support Richard Zhao
` (6 subsequent siblings)
7 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
arch/arm/mach-imx/mach-imx6q.c | 1 +
2 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
new file mode 100644
index 0000000..d54363f
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx6q.dtsi"
+
+/ {
+ model = "Freescale i.MX6 Quad SABRE Lite Board";
+ compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
+
+ chosen {
+ bootargs = "console=ttymxc1,115200";
+ };
+
+ memory {
+ reg = <0x10000000 0x40000000>;
+ };
+
+ soc {
+ aips-bus at 02100000 { /* AIPS2 */
+ enet at 02188000 {
+ phy-mode = "rgmii";
+ local-mac-address = [01 04 9F 01 1B 61];
+ phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
+ status = "okay";
+ };
+
+ usdhc at 02198000 { /* uSDHC3 */
+ cd-gpios = <&gpio6 0 0>; /* GPIO7_0 */
+ wp-gpios = <&gpio6 1 0>; /* GPIO7_1 */
+ status = "okay";
+ };
+
+ usdhc at 0219c000 { /* uSDHC4 */
+ cd-gpios = <&gpio1 6 0>; /* GPIO2_6 */
+ wp-gpios = <&gpio1 7 0>; /* GPIO2_7 */
+ status = "okay";
+ };
+
+ uart1: uart at 021e8000 { /* UART2 */
+ status = "okay";
+ };
+ };
+ };
+};
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 8deb012..d24d6c4 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -73,6 +73,7 @@ static struct sys_timer imx6q_timer = {
static const char *imx6q_dt_compat[] __initdata = {
"fsl,imx6q-sabreauto",
+ "fsl,imx6q-sabrelite",
NULL,
};
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 3:42 ` [PATCH 1/7] arm/imx6: add imx6q sabrelite board support Richard Zhao
@ 2011-12-12 5:40 ` Shawn Guo
2011-12-12 5:50 ` Richard Zhao
` (3 more replies)
0 siblings, 4 replies; 35+ messages in thread
From: Shawn Guo @ 2011-12-12 5:40 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> ---
> arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> arch/arm/mach-imx/mach-imx6q.c | 1 +
> 2 files changed, 55 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
>
> diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> new file mode 100644
> index 0000000..d54363f
> --- /dev/null
> +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> @@ -0,0 +1,54 @@
> +/*
> + * Copyright 2011 Freescale Semiconductor, Inc.
> + * Copyright 2011 Linaro Ltd.
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +/dts-v1/;
> +/include/ "imx6q.dtsi"
> +
> +/ {
> + model = "Freescale i.MX6 Quad SABRE Lite Board";
> + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> +
> + chosen {
> + bootargs = "console=ttymxc1,115200";
> + };
> +
Maybe we can start dropping this, since kernel is now able to get
bootargs from atags even in case that bootloader can not pass dtb
and the dtb is appended to kernel image.
> + memory {
> + reg = <0x10000000 0x40000000>;
> + };
> +
> + soc {
> + aips-bus at 02100000 { /* AIPS2 */
> + enet at 02188000 {
> + phy-mode = "rgmii";
> + local-mac-address = [01 04 9F 01 1B 61];
Do we still have no way to figure the mac address from hardware setup
(fuse or something) on sabrelite board?
> + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
Nit: If you want to comment it, please comment it in the consistent way,
which is '/* GPIO3_23 */'.
Regards,
Shawn
> + status = "okay";
> + };
> +
> + usdhc at 02198000 { /* uSDHC3 */
> + cd-gpios = <&gpio6 0 0>; /* GPIO7_0 */
> + wp-gpios = <&gpio6 1 0>; /* GPIO7_1 */
> + status = "okay";
> + };
> +
> + usdhc at 0219c000 { /* uSDHC4 */
> + cd-gpios = <&gpio1 6 0>; /* GPIO2_6 */
> + wp-gpios = <&gpio1 7 0>; /* GPIO2_7 */
> + status = "okay";
> + };
> +
> + uart1: uart at 021e8000 { /* UART2 */
> + status = "okay";
> + };
> + };
> + };
> +};
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 8deb012..d24d6c4 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -73,6 +73,7 @@ static struct sys_timer imx6q_timer = {
>
> static const char *imx6q_dt_compat[] __initdata = {
> "fsl,imx6q-sabreauto",
> + "fsl,imx6q-sabrelite",
> NULL,
> };
>
> --
> 1.7.5.4
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 5:40 ` Shawn Guo
@ 2011-12-12 5:50 ` Richard Zhao
2011-12-12 6:08 ` Shawn Guo
2011-12-12 10:12 ` Sascha Hauer
` (2 subsequent siblings)
3 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 5:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:40:54PM +0800, Shawn Guo wrote:
> On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > ---
> > arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> > arch/arm/mach-imx/mach-imx6q.c | 1 +
> > 2 files changed, 55 insertions(+), 0 deletions(-)
> > create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
> >
> > diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > new file mode 100644
> > index 0000000..d54363f
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > @@ -0,0 +1,54 @@
> > +/*
> > + * Copyright 2011 Freescale Semiconductor, Inc.
> > + * Copyright 2011 Linaro Ltd.
> > + *
> > + * The code contained herein is licensed under the GNU General Public
> > + * License. You may obtain a copy of the GNU General Public License
> > + * Version 2 or later at the following locations:
> > + *
> > + * http://www.opensource.org/licenses/gpl-license.html
> > + * http://www.gnu.org/copyleft/gpl.html
> > + */
> > +
> > +/dts-v1/;
> > +/include/ "imx6q.dtsi"
> > +
> > +/ {
> > + model = "Freescale i.MX6 Quad SABRE Lite Board";
> > + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> > +
> > + chosen {
> > + bootargs = "console=ttymxc1,115200";
> > + };
> > +
> Maybe we can start dropping this, since kernel is now able to get
> bootargs from atags even in case that bootloader can not pass dtb
> and the dtb is appended to kernel image.
kernel has a config "Extend bootloader kernel arguments". Does it help
such case?
>
> > + memory {
> > + reg = <0x10000000 0x40000000>;
> > + };
> > +
> > + soc {
> > + aips-bus at 02100000 { /* AIPS2 */
> > + enet at 02188000 {
> > + phy-mode = "rgmii";
> > + local-mac-address = [01 04 9F 01 1B 61];
>
> Do we still have no way to figure the mac address from hardware setup
> (fuse or something) on sabrelite board?
No.
>
> > + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
>
> Nit: If you want to comment it, please comment it in the consistent way,
> which is '/* GPIO3_23 */'.
good catch.
Thanks
Richard
>
> Regards,
> Shawn
>
> > + status = "okay";
> > + };
> > +
> > + usdhc at 02198000 { /* uSDHC3 */
> > + cd-gpios = <&gpio6 0 0>; /* GPIO7_0 */
> > + wp-gpios = <&gpio6 1 0>; /* GPIO7_1 */
> > + status = "okay";
> > + };
> > +
> > + usdhc at 0219c000 { /* uSDHC4 */
> > + cd-gpios = <&gpio1 6 0>; /* GPIO2_6 */
> > + wp-gpios = <&gpio1 7 0>; /* GPIO2_7 */
> > + status = "okay";
> > + };
> > +
> > + uart1: uart at 021e8000 { /* UART2 */
> > + status = "okay";
> > + };
> > + };
> > + };
> > +};
> > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> > index 8deb012..d24d6c4 100644
> > --- a/arch/arm/mach-imx/mach-imx6q.c
> > +++ b/arch/arm/mach-imx/mach-imx6q.c
> > @@ -73,6 +73,7 @@ static struct sys_timer imx6q_timer = {
> >
> > static const char *imx6q_dt_compat[] __initdata = {
> > "fsl,imx6q-sabreauto",
> > + "fsl,imx6q-sabrelite",
> > NULL,
> > };
> >
> > --
> > 1.7.5.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 5:50 ` Richard Zhao
@ 2011-12-12 6:08 ` Shawn Guo
2011-12-12 7:50 ` Richard Zhao
0 siblings, 1 reply; 35+ messages in thread
From: Shawn Guo @ 2011-12-12 6:08 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:50:10PM +0800, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 01:40:54PM +0800, Shawn Guo wrote:
> > On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> > > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > > ---
> > > arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> > > arch/arm/mach-imx/mach-imx6q.c | 1 +
> > > 2 files changed, 55 insertions(+), 0 deletions(-)
> > > create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
> > >
> > > diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > > new file mode 100644
> > > index 0000000..d54363f
> > > --- /dev/null
> > > +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > > @@ -0,0 +1,54 @@
> > > +/*
> > > + * Copyright 2011 Freescale Semiconductor, Inc.
> > > + * Copyright 2011 Linaro Ltd.
> > > + *
> > > + * The code contained herein is licensed under the GNU General Public
> > > + * License. You may obtain a copy of the GNU General Public License
> > > + * Version 2 or later at the following locations:
> > > + *
> > > + * http://www.opensource.org/licenses/gpl-license.html
> > > + * http://www.gnu.org/copyleft/gpl.html
> > > + */
> > > +
> > > +/dts-v1/;
> > > +/include/ "imx6q.dtsi"
> > > +
> > > +/ {
> > > + model = "Freescale i.MX6 Quad SABRE Lite Board";
> > > + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> > > +
> > > + chosen {
> > > + bootargs = "console=ttymxc1,115200";
> > > + };
> > > +
> > Maybe we can start dropping this, since kernel is now able to get
> > bootargs from atags even in case that bootloader can not pass dtb
> > and the dtb is appended to kernel image.
> kernel has a config "Extend bootloader kernel arguments". Does it help
> such case?
CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 6:08 ` Shawn Guo
@ 2011-12-12 7:50 ` Richard Zhao
2011-12-12 8:56 ` Shawn Guo
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 7:50 UTC (permalink / raw)
To: linux-arm-kernel
> > > > +
> > > > + chosen {
> > > > + bootargs = "console=ttymxc1,115200";
> > > > + };
> > > > +
> > > Maybe we can start dropping this, since kernel is now able to get
> > > bootargs from atags even in case that bootloader can not pass dtb
> > > and the dtb is appended to kernel image.
> > kernel has a config "Extend bootloader kernel arguments". Does it help
> > such case?
>
> CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
I don't like puting cmdline in dts either, but kernel provide
CONFIG_CMDLINE_EXTEND and CONFIG_CMDLINE_FORCE, it's better to at least
let uart work. I don't quite insist on it.
Thanks
Richard
>
> --
> Regards,
> Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 7:50 ` Richard Zhao
@ 2011-12-12 8:56 ` Shawn Guo
0 siblings, 0 replies; 35+ messages in thread
From: Shawn Guo @ 2011-12-12 8:56 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 03:50:48PM +0800, Richard Zhao wrote:
> > > > > +
> > > > > + chosen {
> > > > > + bootargs = "console=ttymxc1,115200";
> > > > > + };
> > > > > +
> > > > Maybe we can start dropping this, since kernel is now able to get
> > > > bootargs from atags even in case that bootloader can not pass dtb
> > > > and the dtb is appended to kernel image.
> > > kernel has a config "Extend bootloader kernel arguments". Does it help
> > > such case?
> >
> > CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
> I don't like puting cmdline in dts either, but kernel provide
> CONFIG_CMDLINE_EXTEND and CONFIG_CMDLINE_FORCE, it's better to at least
> let uart work. I don't quite insist on it.
>
It's irrelevant. My point is I do not see a real use case for this
'bootargs' from dts. If your u-boot can pass dtb to kernel, it will
replace the chosen node with its own 'bootargs' parameter anyway.
If your u-boot is too old to pass dtb, you will probably need to enable
CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT to append dtb
to kernel image and have kernel parse 'bootargs' from atags.
That said, in both case, we want to use bootargs set by bootloader.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 5:40 ` Shawn Guo
2011-12-12 5:50 ` Richard Zhao
@ 2011-12-12 10:12 ` Sascha Hauer
2011-12-12 10:18 ` Richard Zhao
2011-12-12 13:41 ` Rob Herring
2011-12-12 20:39 ` Troy Kisky
3 siblings, 1 reply; 35+ messages in thread
From: Sascha Hauer @ 2011-12-12 10:12 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:40:54PM +0800, Shawn Guo wrote:
>
> > + memory {
> > + reg = <0x10000000 0x40000000>;
> > + };
> > +
> > + soc {
> > + aips-bus at 02100000 { /* AIPS2 */
> > + enet at 02188000 {
> > + phy-mode = "rgmii";
> > + local-mac-address = [01 04 9F 01 1B 61];
>
> Do we still have no way to figure the mac address from hardware setup
> (fuse or something) on sabrelite board?
Even if not, adding hardcoded MAC addresses to the kernel is a no go.
This includes devicetree blobs.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 10:12 ` Sascha Hauer
@ 2011-12-12 10:18 ` Richard Zhao
2011-12-12 10:26 ` Sascha Hauer
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 10:18 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:12:24AM +0100, Sascha Hauer wrote:
> On Mon, Dec 12, 2011 at 01:40:54PM +0800, Shawn Guo wrote:
> >
> > > + memory {
> > > + reg = <0x10000000 0x40000000>;
> > > + };
> > > +
> > > + soc {
> > > + aips-bus at 02100000 { /* AIPS2 */
> > > + enet at 02188000 {
> > > + phy-mode = "rgmii";
> > > + local-mac-address = [01 04 9F 01 1B 61];
> >
> > Do we still have no way to figure the mac address from hardware setup
> > (fuse or something) on sabrelite board?
>
> Even if not, adding hardcoded MAC addresses to the kernel is a no go.
> This includes devicetree blobs.
If Shawn agree, I can remove it. I don't feel it usefaull on daily develop work.
Let user use fec.macaddr.
Thanks
Richard
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 10:18 ` Richard Zhao
@ 2011-12-12 10:26 ` Sascha Hauer
0 siblings, 0 replies; 35+ messages in thread
From: Sascha Hauer @ 2011-12-12 10:26 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 06:18:38PM +0800, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 11:12:24AM +0100, Sascha Hauer wrote:
> > On Mon, Dec 12, 2011 at 01:40:54PM +0800, Shawn Guo wrote:
> > >
> > > > + memory {
> > > > + reg = <0x10000000 0x40000000>;
> > > > + };
> > > > +
> > > > + soc {
> > > > + aips-bus at 02100000 { /* AIPS2 */
> > > > + enet at 02188000 {
> > > > + phy-mode = "rgmii";
> > > > + local-mac-address = [01 04 9F 01 1B 61];
> > >
> > > Do we still have no way to figure the mac address from hardware setup
> > > (fuse or something) on sabrelite board?
> >
> > Even if not, adding hardcoded MAC addresses to the kernel is a no go.
> > This includes devicetree blobs.
> If Shawn agree, I can remove it. I don't feel it usefaull on daily develop work.
> Let user use fec.macaddr.
How useful this is you'll realize when all your collegues end up
with the same MAC address. Just remove it.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 5:40 ` Shawn Guo
2011-12-12 5:50 ` Richard Zhao
2011-12-12 10:12 ` Sascha Hauer
@ 2011-12-12 13:41 ` Rob Herring
2011-12-12 13:49 ` Richard Zhao
2011-12-12 20:39 ` Troy Kisky
3 siblings, 1 reply; 35+ messages in thread
From: Rob Herring @ 2011-12-12 13:41 UTC (permalink / raw)
To: linux-arm-kernel
On 12/11/2011 11:40 PM, Shawn Guo wrote:
> On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
>> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
>> ---
>> arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
>> arch/arm/mach-imx/mach-imx6q.c | 1 +
>> 2 files changed, 55 insertions(+), 0 deletions(-)
>> create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
>>
>> diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
>> new file mode 100644
>> index 0000000..d54363f
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
>> @@ -0,0 +1,54 @@
>> +/*
>> + * Copyright 2011 Freescale Semiconductor, Inc.
>> + * Copyright 2011 Linaro Ltd.
>> + *
>> + * The code contained herein is licensed under the GNU General Public
>> + * License. You may obtain a copy of the GNU General Public License
>> + * Version 2 or later at the following locations:
>> + *
>> + * http://www.opensource.org/licenses/gpl-license.html
>> + * http://www.gnu.org/copyleft/gpl.html
>> + */
>> +
>> +/dts-v1/;
>> +/include/ "imx6q.dtsi"
>> +
>> +/ {
>> + model = "Freescale i.MX6 Quad SABRE Lite Board";
>> + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
>> +
>> + chosen {
>> + bootargs = "console=ttymxc1,115200";
>> + };
>> +
> Maybe we can start dropping this, since kernel is now able to get
> bootargs from atags even in case that bootloader can not pass dtb
> and the dtb is appended to kernel image.
>
>> + memory {
>> + reg = <0x10000000 0x40000000>;
>> + };
>> +
>> + soc {
>> + aips-bus at 02100000 { /* AIPS2 */
>> + enet at 02188000 {
>> + phy-mode = "rgmii";
>> + local-mac-address = [01 04 9F 01 1B 61];
>
> Do we still have no way to figure the mac address from hardware setup
> (fuse or something) on sabrelite board?
>
>> + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
>
> Nit: If you want to comment it, please comment it in the consistent way,
> which is '/* GPIO3_23 */'.
Better yet, why don't you name the phandles starting at 1 so the comment
isn't needed at all.
Rob
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 13:41 ` Rob Herring
@ 2011-12-12 13:49 ` Richard Zhao
2011-12-12 14:44 ` Shawn Guo
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 13:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 07:41:17AM -0600, Rob Herring wrote:
> On 12/11/2011 11:40 PM, Shawn Guo wrote:
> > On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> >> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> >> ---
> >> arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> >> arch/arm/mach-imx/mach-imx6q.c | 1 +
> >> 2 files changed, 55 insertions(+), 0 deletions(-)
> >> create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
> >>
> >> diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> >> new file mode 100644
> >> index 0000000..d54363f
> >> --- /dev/null
> >> +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> >> @@ -0,0 +1,54 @@
> >> +/*
> >> + * Copyright 2011 Freescale Semiconductor, Inc.
> >> + * Copyright 2011 Linaro Ltd.
> >> + *
> >> + * The code contained herein is licensed under the GNU General Public
> >> + * License. You may obtain a copy of the GNU General Public License
> >> + * Version 2 or later at the following locations:
> >> + *
> >> + * http://www.opensource.org/licenses/gpl-license.html
> >> + * http://www.gnu.org/copyleft/gpl.html
> >> + */
> >> +
> >> +/dts-v1/;
> >> +/include/ "imx6q.dtsi"
> >> +
> >> +/ {
> >> + model = "Freescale i.MX6 Quad SABRE Lite Board";
> >> + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> >> +
> >> + chosen {
> >> + bootargs = "console=ttymxc1,115200";
> >> + };
> >> +
> > Maybe we can start dropping this, since kernel is now able to get
> > bootargs from atags even in case that bootloader can not pass dtb
> > and the dtb is appended to kernel image.
> >
> >> + memory {
> >> + reg = <0x10000000 0x40000000>;
> >> + };
> >> +
> >> + soc {
> >> + aips-bus at 02100000 { /* AIPS2 */
> >> + enet at 02188000 {
> >> + phy-mode = "rgmii";
> >> + local-mac-address = [01 04 9F 01 1B 61];
> >
> > Do we still have no way to figure the mac address from hardware setup
> > (fuse or something) on sabrelite board?
> >
> >> + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
> >
> > Nit: If you want to comment it, please comment it in the consistent way,
> > which is '/* GPIO3_23 */'.
>
> Better yet, why don't you name the phandles starting at 1 so the comment
> isn't needed at all.
Good idea, but it needs another patch, because it effects all imx6 boards.
Shawn, what do you think?
Thanks
Richard
>
> Rob
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 13:49 ` Richard Zhao
@ 2011-12-12 14:44 ` Shawn Guo
2011-12-13 0:54 ` Richard Zhao
0 siblings, 1 reply; 35+ messages in thread
From: Shawn Guo @ 2011-12-12 14:44 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 09:49:54PM +0800, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 07:41:17AM -0600, Rob Herring wrote:
> > On 12/11/2011 11:40 PM, Shawn Guo wrote:
> > > On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> > >> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > >> ---
> > >> arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> > >> arch/arm/mach-imx/mach-imx6q.c | 1 +
> > >> 2 files changed, 55 insertions(+), 0 deletions(-)
> > >> create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
> > >>
> > >> diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > >> new file mode 100644
> > >> index 0000000..d54363f
> > >> --- /dev/null
> > >> +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > >> @@ -0,0 +1,54 @@
> > >> +/*
> > >> + * Copyright 2011 Freescale Semiconductor, Inc.
> > >> + * Copyright 2011 Linaro Ltd.
> > >> + *
> > >> + * The code contained herein is licensed under the GNU General Public
> > >> + * License. You may obtain a copy of the GNU General Public License
> > >> + * Version 2 or later at the following locations:
> > >> + *
> > >> + * http://www.opensource.org/licenses/gpl-license.html
> > >> + * http://www.gnu.org/copyleft/gpl.html
> > >> + */
> > >> +
> > >> +/dts-v1/;
> > >> +/include/ "imx6q.dtsi"
> > >> +
> > >> +/ {
> > >> + model = "Freescale i.MX6 Quad SABRE Lite Board";
> > >> + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> > >> +
> > >> + chosen {
> > >> + bootargs = "console=ttymxc1,115200";
> > >> + };
> > >> +
> > > Maybe we can start dropping this, since kernel is now able to get
> > > bootargs from atags even in case that bootloader can not pass dtb
> > > and the dtb is appended to kernel image.
> > >
> > >> + memory {
> > >> + reg = <0x10000000 0x40000000>;
> > >> + };
> > >> +
> > >> + soc {
> > >> + aips-bus at 02100000 { /* AIPS2 */
> > >> + enet at 02188000 {
> > >> + phy-mode = "rgmii";
> > >> + local-mac-address = [01 04 9F 01 1B 61];
> > >
> > > Do we still have no way to figure the mac address from hardware setup
> > > (fuse or something) on sabrelite board?
> > >
> > >> + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
> > >
> > > Nit: If you want to comment it, please comment it in the consistent way,
> > > which is '/* GPIO3_23 */'.
> >
> > Better yet, why don't you name the phandles starting at 1 so the comment
> > isn't needed at all.
> Good idea, but it needs another patch, because it effects all imx6 boards.
> Shawn, what do you think?
>
When I was firstly working out the dts for imx51, I followed what most
dts files do, numbering phandle and label name from 0, while imx
reference manual happens to indexing hardware block from 1. This
mismatch have been existing in kernel for long time, since kernel is
numbering platform device from 0 too.
I'm not really sure if there is a convention on this. But since Rob
(as device tree maintainer) says it can be numbered from 1, I'm fine
to accept a patch fixing this up for all imx dts files.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 14:44 ` Shawn Guo
@ 2011-12-13 0:54 ` Richard Zhao
0 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-13 0:54 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 10:44:47PM +0800, Shawn Guo wrote:
> On Mon, Dec 12, 2011 at 09:49:54PM +0800, Richard Zhao wrote:
> > On Mon, Dec 12, 2011 at 07:41:17AM -0600, Rob Herring wrote:
> > > On 12/11/2011 11:40 PM, Shawn Guo wrote:
> > > > On Mon, Dec 12, 2011 at 11:42:26AM +0800, Richard Zhao wrote:
> > > >> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > > >> ---
> > > >> arch/arm/boot/dts/imx6q-sabrelite.dts | 54 +++++++++++++++++++++++++++++++++
> > > >> arch/arm/mach-imx/mach-imx6q.c | 1 +
> > > >> 2 files changed, 55 insertions(+), 0 deletions(-)
> > > >> create mode 100644 arch/arm/boot/dts/imx6q-sabrelite.dts
> > > >>
> > > >> diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > > >> new file mode 100644
> > > >> index 0000000..d54363f
> > > >> --- /dev/null
> > > >> +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
> > > >> @@ -0,0 +1,54 @@
> > > >> +/*
> > > >> + * Copyright 2011 Freescale Semiconductor, Inc.
> > > >> + * Copyright 2011 Linaro Ltd.
> > > >> + *
> > > >> + * The code contained herein is licensed under the GNU General Public
> > > >> + * License. You may obtain a copy of the GNU General Public License
> > > >> + * Version 2 or later at the following locations:
> > > >> + *
> > > >> + * http://www.opensource.org/licenses/gpl-license.html
> > > >> + * http://www.gnu.org/copyleft/gpl.html
> > > >> + */
> > > >> +
> > > >> +/dts-v1/;
> > > >> +/include/ "imx6q.dtsi"
> > > >> +
> > > >> +/ {
> > > >> + model = "Freescale i.MX6 Quad SABRE Lite Board";
> > > >> + compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
> > > >> +
> > > >> + chosen {
> > > >> + bootargs = "console=ttymxc1,115200";
> > > >> + };
> > > >> +
> > > > Maybe we can start dropping this, since kernel is now able to get
> > > > bootargs from atags even in case that bootloader can not pass dtb
> > > > and the dtb is appended to kernel image.
> > > >
> > > >> + memory {
> > > >> + reg = <0x10000000 0x40000000>;
> > > >> + };
> > > >> +
> > > >> + soc {
> > > >> + aips-bus at 02100000 { /* AIPS2 */
> > > >> + enet at 02188000 {
> > > >> + phy-mode = "rgmii";
> > > >> + local-mac-address = [01 04 9F 01 1B 61];
> > > >
> > > > Do we still have no way to figure the mac address from hardware setup
> > > > (fuse or something) on sabrelite board?
> > > >
> > > >> + phy-reset-gpios = <&gpio2 23 0>; /* gpio3 23 */
> > > >
> > > > Nit: If you want to comment it, please comment it in the consistent way,
> > > > which is '/* GPIO3_23 */'.
> > >
> > > Better yet, why don't you name the phandles starting at 1 so the comment
> > > isn't needed at all.
> > Good idea, but it needs another patch, because it effects all imx6 boards.
> > Shawn, what do you think?
> >
> When I was firstly working out the dts for imx51, I followed what most
> dts files do, numbering phandle and label name from 0, while imx
> reference manual happens to indexing hardware block from 1. This
> mismatch have been existing in kernel for long time, since kernel is
> numbering platform device from 0 too.
>
> I'm not really sure if there is a convention on this. But since Rob
> (as device tree maintainer) says it can be numbered from 1, I'm fine
> to accept a patch fixing this up for all imx dts files.
I'll prepare the patch.
Thanks
Richard
>
> --
> Regards,
> Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 5:40 ` Shawn Guo
` (2 preceding siblings ...)
2011-12-12 13:41 ` Rob Herring
@ 2011-12-12 20:39 ` Troy Kisky
2011-12-13 0:52 ` Richard Zhao
3 siblings, 1 reply; 35+ messages in thread
From: Troy Kisky @ 2011-12-12 20:39 UTC (permalink / raw)
To: linux-arm-kernel
On 12/11/2011 10:40 PM, Shawn Guo wrote:
>> + memory {
>> + reg =<0x10000000 0x40000000>;
>> + };
>> +
>> + soc {
>> + aips-bus at 02100000 { /* AIPS2 */
>> + enet at 02188000 {
>> + phy-mode = "rgmii";
>> + local-mac-address = [01 04 9F 01 1B 61];
> Do we still have no way to figure the mac address from hardware setup
> (fuse or something) on sabrelite board?
>
>
U-boot now has support for blowing the mac fuses.
i.e.
imxotp blow --force 23 0019 ; imxotp blow --force 22 B800e1f5
for a mac of 00:19:b8:00:e1:f5
Most boards already have this done.
Troy
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-12 20:39 ` Troy Kisky
@ 2011-12-13 0:52 ` Richard Zhao
2011-12-13 1:28 ` Shawn Guo
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-13 0:52 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:39:06PM -0700, Troy Kisky wrote:
> On 12/11/2011 10:40 PM, Shawn Guo wrote:
> >>+ memory {
> >>+ reg =<0x10000000 0x40000000>;
> >>+ };
> >>+
> >>+ soc {
> >>+ aips-bus at 02100000 { /* AIPS2 */
> >>+ enet at 02188000 {
> >>+ phy-mode = "rgmii";
> >>+ local-mac-address = [01 04 9F 01 1B 61];
> >Do we still have no way to figure the mac address from hardware setup
> >(fuse or something) on sabrelite board?
> >
> >
> U-boot now has support for blowing the mac fuses.
>
> i.e.
> imxotp blow --force 23 0019 ; imxotp blow --force 22 B800e1f5
>
> for a mac of 00:19:b8:00:e1:f5
>
> Most boards already have this done.
It's software issue here. When use DT, we don't still have patch to
read fuse and pass mac address to fec driver. Currently, we can use
bootargs fec.macaddr.
Thanks
Richard
>
> Troy
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-13 0:52 ` Richard Zhao
@ 2011-12-13 1:28 ` Shawn Guo
2011-12-13 1:32 ` Richard Zhao
0 siblings, 1 reply; 35+ messages in thread
From: Shawn Guo @ 2011-12-13 1:28 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 13, 2011 at 08:52:14AM +0800, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 01:39:06PM -0700, Troy Kisky wrote:
> > On 12/11/2011 10:40 PM, Shawn Guo wrote:
> > >>+ memory {
> > >>+ reg =<0x10000000 0x40000000>;
> > >>+ };
> > >>+
> > >>+ soc {
> > >>+ aips-bus at 02100000 { /* AIPS2 */
> > >>+ enet at 02188000 {
> > >>+ phy-mode = "rgmii";
> > >>+ local-mac-address = [01 04 9F 01 1B 61];
> > >Do we still have no way to figure the mac address from hardware setup
> > >(fuse or something) on sabrelite board?
> > >
> > >
> > U-boot now has support for blowing the mac fuses.
> >
> > i.e.
> > imxotp blow --force 23 0019 ; imxotp blow --force 22 B800e1f5
> >
> > for a mac of 00:19:b8:00:e1:f5
> >
> > Most boards already have this done.
> It's software issue here. When use DT, we don't still have patch to
> read fuse and pass mac address to fec driver. Currently, we can use
> bootargs fec.macaddr.
>
Okay, if it's a software issue, we should sort it out right now. Plus
the fec phy fixup hook, I have seen two cases that we need to pass
platform_data for fec driver, so let us do it.
Regards,
Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 1/7] arm/imx6: add imx6q sabrelite board support
2011-12-13 1:28 ` Shawn Guo
@ 2011-12-13 1:32 ` Richard Zhao
0 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-13 1:32 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 13, 2011 at 09:28:17AM +0800, Shawn Guo wrote:
> On Tue, Dec 13, 2011 at 08:52:14AM +0800, Richard Zhao wrote:
> > On Mon, Dec 12, 2011 at 01:39:06PM -0700, Troy Kisky wrote:
> > > On 12/11/2011 10:40 PM, Shawn Guo wrote:
> > > >>+ memory {
> > > >>+ reg =<0x10000000 0x40000000>;
> > > >>+ };
> > > >>+
> > > >>+ soc {
> > > >>+ aips-bus at 02100000 { /* AIPS2 */
> > > >>+ enet at 02188000 {
> > > >>+ phy-mode = "rgmii";
> > > >>+ local-mac-address = [01 04 9F 01 1B 61];
> > > >Do we still have no way to figure the mac address from hardware setup
> > > >(fuse or something) on sabrelite board?
> > > >
> > > >
> > > U-boot now has support for blowing the mac fuses.
> > >
> > > i.e.
> > > imxotp blow --force 23 0019 ; imxotp blow --force 22 B800e1f5
> > >
> > > for a mac of 00:19:b8:00:e1:f5
> > >
> > > Most boards already have this done.
> > It's software issue here. When use DT, we don't still have patch to
> > read fuse and pass mac address to fec driver. Currently, we can use
> > bootargs fec.macaddr.
> >
> Okay, if it's a software issue, we should sort it out right now. Plus
> the fec phy fixup hook, I have seen two cases that we need to pass
> platform_data for fec driver, so let us do it.
right, I'm glad to see patch fix it too. but I think it's out of scope of
this patch series. The patch series is for enablement.
Thanks
Richard
>
> Regards,
> Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 2/7] arm/imx: cpufreq: add multi-core support
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
2011-12-12 3:42 ` [PATCH 1/7] arm/imx6: add imx6q sabrelite board support Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 3:42 ` [PATCH 3/7] ARM: imx: fix cpufreq build errors Richard Zhao
` (5 subsequent siblings)
7 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/cpufreq.c | 99 ++++++++++++++++++++++++++++--------------
1 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index 74aac96..122b21a 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -21,6 +21,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <asm/cpu.h>
#include <mach/hardware.h>
#include <mach/clock.h>
@@ -33,6 +34,7 @@ static int cpu_freq_khz_min;
static int cpu_freq_khz_max;
static struct clk *cpu_clk;
+static DEFINE_MUTEX(cpu_lock);
static struct cpufreq_frequency_table *imx_freq_table;
static int cpu_op_nr;
@@ -58,17 +60,11 @@ static int set_cpu_freq(int freq)
static int mxc_verify_speed(struct cpufreq_policy *policy)
{
- if (policy->cpu != 0)
- return -EINVAL;
-
return cpufreq_frequency_table_verify(policy, imx_freq_table);
}
static unsigned int mxc_get_speed(unsigned int cpu)
{
- if (cpu)
- return 0;
-
return clk_get_rate(cpu_clk) / 1000;
}
@@ -76,23 +72,49 @@ static int mxc_set_target(struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int relation)
{
struct cpufreq_freqs freqs;
- int freq_Hz;
+ int freq_Hz, cpu;
int ret = 0;
unsigned int index;
+ mutex_lock(&cpu_lock);
+
cpufreq_frequency_table_target(policy, imx_freq_table,
target_freq, relation, &index);
freq_Hz = imx_freq_table[index].frequency * 1000;
freqs.old = clk_get_rate(cpu_clk) / 1000;
- freqs.new = freq_Hz / 1000;
- freqs.cpu = 0;
+ freqs.new = clk_round_rate(cpu_clk, freq_Hz);
+ freqs.new = (freqs.new ? freqs.new : freq_Hz) / 1000;
freqs.flags = 0;
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+
+ if (freqs.old == freqs.new) {
+ mutex_unlock(&cpu_lock);
+ return 0;
+ }
+
+ for_each_possible_cpu(cpu) {
+ freqs.cpu = cpu;
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+ }
ret = set_cpu_freq(freq_Hz);
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+#ifdef CONFIG_SMP
+ /* loops_per_jiffy is not updated by the cpufreq core for SMP systems.
+ * So update it for all CPUs.
+ */
+ for_each_possible_cpu(cpu)
+ per_cpu(cpu_data, cpu).loops_per_jiffy =
+ cpufreq_scale(per_cpu(cpu_data, cpu).loops_per_jiffy,
+ freqs.old, freqs.new);
+#endif
+
+ for_each_possible_cpu(cpu) {
+ freqs.cpu = cpu;
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+ }
+
+ mutex_unlock(&cpu_lock);
return ret;
}
@@ -104,7 +126,7 @@ static int __init mxc_cpufreq_init(struct cpufreq_policy *policy)
printk(KERN_INFO "i.MXC CPU frequency driver\n");
- if (policy->cpu != 0)
+ if (policy->cpu >= num_possible_cpus())
return -EINVAL;
if (!get_cpu_op)
@@ -116,37 +138,45 @@ static int __init mxc_cpufreq_init(struct cpufreq_policy *policy)
return PTR_ERR(cpu_clk);
}
- cpu_op_tbl = get_cpu_op(&cpu_op_nr);
+ mutex_lock(&cpu_lock);
+ if (!imx_freq_table) {
+ cpu_op_tbl = get_cpu_op(&cpu_op_nr);
- cpu_freq_khz_min = cpu_op_tbl[0].cpu_rate / 1000;
- cpu_freq_khz_max = cpu_op_tbl[0].cpu_rate / 1000;
+ cpu_freq_khz_min = cpu_op_tbl[0].cpu_rate / 1000;
+ cpu_freq_khz_max = cpu_op_tbl[0].cpu_rate / 1000;
- imx_freq_table = kmalloc(
- sizeof(struct cpufreq_frequency_table) * (cpu_op_nr + 1),
- GFP_KERNEL);
- if (!imx_freq_table) {
- ret = -ENOMEM;
- goto err1;
- }
+ imx_freq_table = kmalloc(sizeof(struct cpufreq_frequency_table)
+ * (cpu_op_nr + 1), GFP_KERNEL);
+ if (!imx_freq_table) {
+ ret = -ENOMEM;
+ mutex_unlock(&cpu_lock);
+ goto err1;
+ }
- for (i = 0; i < cpu_op_nr; i++) {
- imx_freq_table[i].index = i;
- imx_freq_table[i].frequency = cpu_op_tbl[i].cpu_rate / 1000;
+ for (i = 0; i < cpu_op_nr; i++) {
+ imx_freq_table[i].index = i;
+ imx_freq_table[i].frequency =
+ cpu_op_tbl[i].cpu_rate / 1000;
- if ((cpu_op_tbl[i].cpu_rate / 1000) < cpu_freq_khz_min)
- cpu_freq_khz_min = cpu_op_tbl[i].cpu_rate / 1000;
+ if ((cpu_op_tbl[i].cpu_rate / 1000) < cpu_freq_khz_min)
+ cpu_freq_khz_min =
+ cpu_op_tbl[i].cpu_rate / 1000;
- if ((cpu_op_tbl[i].cpu_rate / 1000) > cpu_freq_khz_max)
- cpu_freq_khz_max = cpu_op_tbl[i].cpu_rate / 1000;
- }
+ if ((cpu_op_tbl[i].cpu_rate / 1000) > cpu_freq_khz_max)
+ cpu_freq_khz_max =
+ cpu_op_tbl[i].cpu_rate / 1000;
+ }
- imx_freq_table[i].index = i;
- imx_freq_table[i].frequency = CPUFREQ_TABLE_END;
+ imx_freq_table[i].index = i;
+ imx_freq_table[i].frequency = CPUFREQ_TABLE_END;
+ }
+ mutex_unlock(&cpu_lock);
policy->cur = clk_get_rate(cpu_clk) / 1000;
policy->min = policy->cpuinfo.min_freq = cpu_freq_khz_min;
policy->max = policy->cpuinfo.max_freq = cpu_freq_khz_max;
-
+ policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
+ cpumask_setall(policy->cpus);
/* Manual states, that PLL stabilizes in two CLK32 periods */
policy->cpuinfo.transition_latency = 2 * NANOSECOND / CLK32_FREQ;
@@ -173,7 +203,10 @@ static int mxc_cpufreq_exit(struct cpufreq_policy *policy)
set_cpu_freq(cpu_freq_khz_max * 1000);
clk_put(cpu_clk);
+ mutex_lock(&cpu_lock);
kfree(imx_freq_table);
+ imx_freq_table = NULL;
+ mutex_unlock(&cpu_lock);
return 0;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 3/7] ARM: imx: fix cpufreq build errors
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
2011-12-12 3:42 ` [PATCH 1/7] arm/imx6: add imx6q sabrelite board support Richard Zhao
2011-12-12 3:42 ` [PATCH 2/7] arm/imx: cpufreq: add multi-core support Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 4:47 ` Richard Zhao
2011-12-12 3:42 ` [PATCH 4/7] arm/imx: fix cpufreq section mismatch Richard Zhao
` (4 subsequent siblings)
7 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
From: Richard Zhao <richard.zhao@freescale.com>
CC arch/arm/plat-mxc/cpufreq.o
arch/arm/plat-mxc/cpufreq.c:203: error: expected declaration specifiers or '...' before string constant
arch/arm/plat-mxc/cpufreq.c:203: warning: data definition has no type or storage class
arch/arm/plat-mxc/cpufreq.c:203: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
arch/arm/plat-mxc/cpufreq.c:203: warning: function declaration isn't a prototype
arch/arm/plat-mxc/cpufreq.c:204: error: expected declaration specifiers or '...' before string constant
arch/arm/plat-mxc/cpufreq.c:204: warning: data definition has no type or storage class
arch/arm/plat-mxc/cpufreq.c:204: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
arch/arm/plat-mxc/cpufreq.c:204: warning: function declaration isn't a prototype
arch/arm/plat-mxc/cpufreq.c:205: error: expected declaration specifiers or '...' before string constant
arch/arm/plat-mxc/cpufreq.c:205: warning: data definition has no type or storage class
arch/arm/plat-mxc/cpufreq.c:205: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
arch/arm/plat-mxc/cpufreq.c:205: warning: function declaration isn't a prototype
make[1]: *** [arch/arm/plat-mxc/cpufreq.o] Error 1
make: *** [arch/arm/plat-mxc] Error 2
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/cpufreq.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index 122b21a..85d037f 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -17,6 +17,7 @@
* the CPU clock speed on the fly.
*/
+#include <linux/module.h>
#include <linux/cpufreq.h>
#include <linux/clk.h>
#include <linux/err.h>
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 4/7] arm/imx: fix cpufreq section mismatch
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
` (2 preceding siblings ...)
2011-12-12 3:42 ` [PATCH 3/7] ARM: imx: fix cpufreq build errors Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 3:42 ` [PATCH 5/7] arm/imx: add cpu_voltage to cpu_op Richard Zhao
` (3 subsequent siblings)
7 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
WARNING: arch/arm/plat-mxc/built-in.o(.data+0x488): Section mismatch in reference from the variable mxc_driver to the function .init.text:mxc_cpufreq_init()
The variable mxc_driver references
the function __init mxc_cpufreq_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/cpufreq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index 85d037f..71e0d09 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -120,7 +120,7 @@ static int mxc_set_target(struct cpufreq_policy *policy,
return ret;
}
-static int __init mxc_cpufreq_init(struct cpufreq_policy *policy)
+static int mxc_cpufreq_init(struct cpufreq_policy *policy)
{
int ret;
int i;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 5/7] arm/imx: add cpu_voltage to cpu_op
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
` (3 preceding siblings ...)
2011-12-12 3:42 ` [PATCH 4/7] arm/imx: fix cpufreq section mismatch Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 3:42 ` [PATCH 6/7] arm/imx6q: add cpufreq support Richard Zhao
` (2 subsequent siblings)
7 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
Help cpu_op table have cpu_voltage info and cpufreq driver
to change cpu voltage.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/include/mach/mxc.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index a4d36d6..1ff7fe7 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -166,6 +166,7 @@ extern unsigned int __mxc_cpu_type;
struct cpu_op {
u32 cpu_rate;
+ int cpu_voltage;
};
int tzic_enable_wake(int is_idle);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
` (4 preceding siblings ...)
2011-12-12 3:42 ` [PATCH 5/7] arm/imx: add cpu_voltage to cpu_op Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-12 12:44 ` Sascha Hauer
2011-12-12 14:10 ` Russell King - ARM Linux
2011-12-12 3:42 ` [PATCH 7/7] arm/imx6q: register arm_clk to clkdev Richard Zhao
2011-12-12 5:48 ` [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Shawn Guo
7 siblings, 2 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/mach-imx/Kconfig | 1 +
arch/arm/mach-imx/Makefile | 2 +-
arch/arm/mach-imx/cpu_op-imx6q.c | 78 ++++++++++++++++++++++++++++++++++++++
3 files changed, 80 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-imx/cpu_op-imx6q.c
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index fbd414b..7d813a3 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -837,6 +837,7 @@ config SOC_IMX6Q
select ARM_GIC
select CACHE_L2X0
select CPU_V7
+ select ARCH_HAS_CPUFREQ
select HAVE_ARM_SCU
select HAVE_IMX_GPC
select HAVE_IMX_MMDC
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 9cf630a..2dfe4a7 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -72,7 +72,7 @@ AFLAGS_head-v7.o :=-Wa,-march=armv7-a
obj-$(CONFIG_SMP) += platsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
-obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o
+obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o cpu_op-imx6q.o
# i.MX5 based machines
obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
diff --git a/arch/arm/mach-imx/cpu_op-imx6q.c b/arch/arm/mach-imx/cpu_op-imx6q.c
new file mode 100644
index 0000000..8807b96
--- /dev/null
+++ b/arch/arm/mach-imx/cpu_op-imx6q.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <mach/hardware.h>
+
+static u32 arm_max_freq;
+static int num_cpu_op;
+
+/* working point(wp): 0 - 1GHzMHz; 1 - 800MHz, 3 - 400MHz, 4 - 160MHz */
+static struct cpu_op mx6q_cpu_op_1G[] = {
+ {
+ .cpu_rate = 996000000,
+ .cpu_voltage = 1225000,},
+ {
+ .cpu_rate = 792000000,
+ .cpu_voltage = 1100000,},
+ {
+ .cpu_rate = 396000000,
+ .cpu_voltage = 950000,},
+ {
+ .cpu_rate = 198000000,
+ .cpu_voltage = 850000,},
+};
+
+static struct cpu_op mx6q_cpu_op[] = {
+ {
+ .cpu_rate = 792000000,
+ .cpu_voltage = 1100000,},
+ {
+ .cpu_rate = 396000000,
+ .cpu_voltage = 950000,},
+ {
+ .cpu_rate = 198000000,
+ .cpu_voltage = 850000,},
+};
+
+struct cpu_op *mx6q_get_cpu_op(int *op)
+{
+ if (arm_max_freq == 1000) {
+ *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op_1G);
+ return mx6q_cpu_op_1G;
+ } else {
+ *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op);
+ return mx6q_cpu_op;
+ }
+}
+
+static int __init mx6q_cpu_op_init(void)
+{
+ get_cpu_op = mx6q_get_cpu_op;
+ return 0;
+}
+
+core_initcall(mx6q_cpu_op_init);
+
+static int __init set_arm_max_freq(char *p)
+{
+ if (strncmp(p, "1000", 4) == 0)
+ arm_max_freq = 1000;
+ else if (strncmp(p, "800", 3) == 0)
+ arm_max_freq = 800;
+ return 0;
+}
+
+early_param("arm_freq", set_arm_max_freq);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 3:42 ` [PATCH 6/7] arm/imx6q: add cpufreq support Richard Zhao
@ 2011-12-12 12:44 ` Sascha Hauer
2011-12-12 13:46 ` Richard Zhao
2011-12-12 14:10 ` Russell King - ARM Linux
1 sibling, 1 reply; 35+ messages in thread
From: Sascha Hauer @ 2011-12-12 12:44 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:42:31AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> ---
> arch/arm/mach-imx/Kconfig | 1 +
> arch/arm/mach-imx/Makefile | 2 +-
> arch/arm/mach-imx/cpu_op-imx6q.c | 78 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 80 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/mach-imx/cpu_op-imx6q.c
>
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index fbd414b..7d813a3 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -837,6 +837,7 @@ config SOC_IMX6Q
> select ARM_GIC
> select CACHE_L2X0
> select CPU_V7
> + select ARCH_HAS_CPUFREQ
> select HAVE_ARM_SCU
> select HAVE_IMX_GPC
> select HAVE_IMX_MMDC
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 9cf630a..2dfe4a7 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -72,7 +72,7 @@ AFLAGS_head-v7.o :=-Wa,-march=armv7-a
> obj-$(CONFIG_SMP) += platsmp.o
> obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
> obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
> -obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o
> +obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o cpu_op-imx6q.o
>
> # i.MX5 based machines
> obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
> diff --git a/arch/arm/mach-imx/cpu_op-imx6q.c b/arch/arm/mach-imx/cpu_op-imx6q.c
> new file mode 100644
> index 0000000..8807b96
> --- /dev/null
> +++ b/arch/arm/mach-imx/cpu_op-imx6q.c
> @@ -0,0 +1,78 @@
> +/*
> + * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
> + */
> +
> +/*
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +#include <linux/types.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <mach/hardware.h>
> +
> +static u32 arm_max_freq;
> +static int num_cpu_op;
Unused variable.
> +
> +/* working point(wp): 0 - 1GHzMHz; 1 - 800MHz, 3 - 400MHz, 4 - 160MHz */
s/GHzMHz/GHz/
> +static struct cpu_op mx6q_cpu_op_1G[] = {
> + {
> + .cpu_rate = 996000000,
> + .cpu_voltage = 1225000,},
> + {
Strange indention.
> + .cpu_rate = 792000000,
> + .cpu_voltage = 1100000,},
> + {
> + .cpu_rate = 396000000,
> + .cpu_voltage = 950000,},
> + {
> + .cpu_rate = 198000000,
> + .cpu_voltage = 850000,},
> +};
> +
> +static struct cpu_op mx6q_cpu_op[] = {
> + {
> + .cpu_rate = 792000000,
> + .cpu_voltage = 1100000,},
> + {
> + .cpu_rate = 396000000,
> + .cpu_voltage = 950000,},
> + {
> + .cpu_rate = 198000000,
> + .cpu_voltage = 850000,},
> +};
> +
> +struct cpu_op *mx6q_get_cpu_op(int *op)
> +{
> + if (arm_max_freq == 1000) {
> + *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op_1G);
> + return mx6q_cpu_op_1G;
> + } else {
> + *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op);
> + return mx6q_cpu_op;
> + }
Why not just return &mx6q_cpu_op[1] instead of creating a second array?
> +}
> +
> +static int __init mx6q_cpu_op_init(void)
> +{
> + get_cpu_op = mx6q_get_cpu_op;
> + return 0;
> +}
> +
> +core_initcall(mx6q_cpu_op_init);
> +
> +static int __init set_arm_max_freq(char *p)
> +{
> + if (strncmp(p, "1000", 4) == 0)
> + arm_max_freq = 1000;
> + else if (strncmp(p, "800", 3) == 0)
> + arm_max_freq = 800;
> + return 0;
> +}
> +
> +early_param("arm_freq", set_arm_max_freq);
Do we need this? I suppose this should be passed by the device tree if
necessary.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 12:44 ` Sascha Hauer
@ 2011-12-12 13:46 ` Richard Zhao
2011-12-12 14:28 ` Sascha Hauer
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 13:46 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:44:36PM +0100, Sascha Hauer wrote:
> On Mon, Dec 12, 2011 at 11:42:31AM +0800, Richard Zhao wrote:
> > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > ---
> > arch/arm/mach-imx/Kconfig | 1 +
> > arch/arm/mach-imx/Makefile | 2 +-
> > arch/arm/mach-imx/cpu_op-imx6q.c | 78 ++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 80 insertions(+), 1 deletions(-)
> > create mode 100644 arch/arm/mach-imx/cpu_op-imx6q.c
> >
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index fbd414b..7d813a3 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -837,6 +837,7 @@ config SOC_IMX6Q
> > select ARM_GIC
> > select CACHE_L2X0
> > select CPU_V7
> > + select ARCH_HAS_CPUFREQ
> > select HAVE_ARM_SCU
> > select HAVE_IMX_GPC
> > select HAVE_IMX_MMDC
> > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > index 9cf630a..2dfe4a7 100644
> > --- a/arch/arm/mach-imx/Makefile
> > +++ b/arch/arm/mach-imx/Makefile
> > @@ -72,7 +72,7 @@ AFLAGS_head-v7.o :=-Wa,-march=armv7-a
> > obj-$(CONFIG_SMP) += platsmp.o
> > obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
> > obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
> > -obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o
> > +obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o cpu_op-imx6q.o
> >
> > # i.MX5 based machines
> > obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
> > diff --git a/arch/arm/mach-imx/cpu_op-imx6q.c b/arch/arm/mach-imx/cpu_op-imx6q.c
> > new file mode 100644
> > index 0000000..8807b96
> > --- /dev/null
> > +++ b/arch/arm/mach-imx/cpu_op-imx6q.c
> > @@ -0,0 +1,78 @@
> > +/*
> > + * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
> > + */
> > +
> > +/*
> > + * The code contained herein is licensed under the GNU General Public
> > + * License. You may obtain a copy of the GNU General Public License
> > + * Version 2 or later at the following locations:
> > + *
> > + * http://www.opensource.org/licenses/gpl-license.html
> > + * http://www.gnu.org/copyleft/gpl.html
> > + */
> > +
> > +#include <linux/types.h>
> > +#include <linux/kernel.h>
> > +#include <linux/string.h>
> > +#include <mach/hardware.h>
> > +
> > +static u32 arm_max_freq;
> > +static int num_cpu_op;
>
> Unused variable.
right, thanks.
>
> > +
> > +/* working point(wp): 0 - 1GHzMHz; 1 - 800MHz, 3 - 400MHz, 4 - 160MHz */
>
> s/GHzMHz/GHz/
ok
>
> > +static struct cpu_op mx6q_cpu_op_1G[] = {
> > + {
> > + .cpu_rate = 996000000,
> > + .cpu_voltage = 1225000,},
> > + {
>
> Strange indention.
{
.cpu_rate = 996000000,
.cpu_voltage = 1225000,
},
I'll change to like above.
>
>
>
> > + .cpu_rate = 792000000,
> > + .cpu_voltage = 1100000,},
> > + {
> > + .cpu_rate = 396000000,
> > + .cpu_voltage = 950000,},
> > + {
> > + .cpu_rate = 198000000,
> > + .cpu_voltage = 850000,},
> > +};
> > +
> > +static struct cpu_op mx6q_cpu_op[] = {
> > + {
> > + .cpu_rate = 792000000,
> > + .cpu_voltage = 1100000,},
> > + {
> > + .cpu_rate = 396000000,
> > + .cpu_voltage = 950000,},
> > + {
> > + .cpu_rate = 198000000,
> > + .cpu_voltage = 850000,},
> > +};
> > +
> > +struct cpu_op *mx6q_get_cpu_op(int *op)
> > +{
> > + if (arm_max_freq == 1000) {
> > + *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op_1G);
> > + return mx6q_cpu_op_1G;
> > + } else {
> > + *op = num_cpu_op = ARRAY_SIZE(mx6q_cpu_op);
> > + return mx6q_cpu_op;
> > + }
>
> Why not just return &mx6q_cpu_op[1] instead of creating a second array?
Good idea.
>
> > +}
> > +
> > +static int __init mx6q_cpu_op_init(void)
> > +{
> > + get_cpu_op = mx6q_get_cpu_op;
> > + return 0;
> > +}
> > +
> > +core_initcall(mx6q_cpu_op_init);
> > +
> > +static int __init set_arm_max_freq(char *p)
> > +{
> > + if (strncmp(p, "1000", 4) == 0)
> > + arm_max_freq = 1000;
> > + else if (strncmp(p, "800", 3) == 0)
> > + arm_max_freq = 800;
> > + return 0;
> > +}
> > +
> > +early_param("arm_freq", set_arm_max_freq);
>
> Do we need this? I suppose this should be passed by the device tree if
> necessary.
Yes, we do. Some boards don't support 1G. Would you let it be a temp solution? Or I'll
only support 1G boards.
For long time, maybe we put all operating points to dts or opp. Which one will
you prefer? It needs much other work to do.
Thanks
Richard
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 13:46 ` Richard Zhao
@ 2011-12-12 14:28 ` Sascha Hauer
0 siblings, 0 replies; 35+ messages in thread
From: Sascha Hauer @ 2011-12-12 14:28 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 09:46:43PM +0800, Richard Zhao wrote:
> > > +{
> > > + if (strncmp(p, "1000", 4) == 0)
> > > + arm_max_freq = 1000;
> > > + else if (strncmp(p, "800", 3) == 0)
> > > + arm_max_freq = 800;
> > > + return 0;
> > > +}
> > > +
> > > +early_param("arm_freq", set_arm_max_freq);
> >
> > Do we need this? I suppose this should be passed by the device tree if
> > necessary.
> Yes, we do. Some boards don't support 1G. Would you let it be a temp solution? Or I'll
> only support 1G boards.
> For long time, maybe we put all operating points to dts or opp. Which one will
> you prefer? It needs much other work to do.
I see several boards already having a clock-frequency property in their
cpu node, so you could use this as maximum frequency.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 3:42 ` [PATCH 6/7] arm/imx6q: add cpufreq support Richard Zhao
2011-12-12 12:44 ` Sascha Hauer
@ 2011-12-12 14:10 ` Russell King - ARM Linux
2011-12-12 14:15 ` Richard Zhao
1 sibling, 1 reply; 35+ messages in thread
From: Russell King - ARM Linux @ 2011-12-12 14:10 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:42:31AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> ---
> arch/arm/mach-imx/Kconfig | 1 +
> arch/arm/mach-imx/Makefile | 2 +-
> arch/arm/mach-imx/cpu_op-imx6q.c | 78 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 80 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/mach-imx/cpu_op-imx6q.c
>
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index fbd414b..7d813a3 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -837,6 +837,7 @@ config SOC_IMX6Q
> select ARM_GIC
> select CACHE_L2X0
> select CPU_V7
> + select ARCH_HAS_CPUFREQ
ABCDEFGH...etc...
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 6/7] arm/imx6q: add cpufreq support
2011-12-12 14:10 ` Russell King - ARM Linux
@ 2011-12-12 14:15 ` Richard Zhao
0 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 14:15 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 02:10:31PM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 12, 2011 at 11:42:31AM +0800, Richard Zhao wrote:
> > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
> > ---
> > arch/arm/mach-imx/Kconfig | 1 +
> > arch/arm/mach-imx/Makefile | 2 +-
> > arch/arm/mach-imx/cpu_op-imx6q.c | 78 ++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 80 insertions(+), 1 deletions(-)
> > create mode 100644 arch/arm/mach-imx/cpu_op-imx6q.c
> >
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index fbd414b..7d813a3 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -837,6 +837,7 @@ config SOC_IMX6Q
> > select ARM_GIC
> > select CACHE_L2X0
> > select CPU_V7
> > + select ARCH_HAS_CPUFREQ
>
> ABCDEFGH...etc...
Right. Thanks for your comments.
Richard
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 7/7] arm/imx6q: register arm_clk to clkdev
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
` (5 preceding siblings ...)
2011-12-12 3:42 ` [PATCH 6/7] arm/imx6q: add cpufreq support Richard Zhao
@ 2011-12-12 3:42 ` Richard Zhao
2011-12-13 1:34 ` Shawn Guo
2011-12-12 5:48 ` [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Shawn Guo
7 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 3:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/mach-imx/clock-imx6q.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index 039a7ab..2525380 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1911,6 +1911,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "gpmi_io_clk", gpmi_io_clk),
_REGISTER_CLOCK(NULL, "usboh3_clk", usboh3_clk),
_REGISTER_CLOCK(NULL, "sata_clk", sata_clk),
+ _REGISTER_CLOCK(NULL, "cpu_clk", arm_clk),
};
int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 35+ messages in thread* [PATCH 7/7] arm/imx6q: register arm_clk to clkdev
2011-12-12 3:42 ` [PATCH 7/7] arm/imx6q: register arm_clk to clkdev Richard Zhao
@ 2011-12-13 1:34 ` Shawn Guo
2011-12-13 1:33 ` Richard Zhao
0 siblings, 1 reply; 35+ messages in thread
From: Shawn Guo @ 2011-12-13 1:34 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:42:32AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
It's always a good practice to add some commit message even for one
line patch. When you try to do that, you can usually find something
to note in the message. For this particular example, you may want to
note why 'cpu_clk' needs to be in clk_lookup table.
Regards,
Shawn
> ---
> arch/arm/mach-imx/clock-imx6q.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
> index 039a7ab..2525380 100644
> --- a/arch/arm/mach-imx/clock-imx6q.c
> +++ b/arch/arm/mach-imx/clock-imx6q.c
> @@ -1911,6 +1911,7 @@ static struct clk_lookup lookups[] = {
> _REGISTER_CLOCK(NULL, "gpmi_io_clk", gpmi_io_clk),
> _REGISTER_CLOCK(NULL, "usboh3_clk", usboh3_clk),
> _REGISTER_CLOCK(NULL, "sata_clk", sata_clk),
> + _REGISTER_CLOCK(NULL, "cpu_clk", arm_clk),
> };
>
> int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
> --
> 1.7.5.4
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 7/7] arm/imx6q: register arm_clk to clkdev
2011-12-13 1:34 ` Shawn Guo
@ 2011-12-13 1:33 ` Richard Zhao
0 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-13 1:33 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 13, 2011 at 09:34:34AM +0800, Shawn Guo wrote:
> On Mon, Dec 12, 2011 at 11:42:32AM +0800, Richard Zhao wrote:
> > Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
>
> It's always a good practice to add some commit message even for one
> line patch. When you try to do that, you can usually find something
> to note in the message. For this particular example, you may want to
> note why 'cpu_clk' needs to be in clk_lookup table.
right, I'll fix it in next version.
Thanks
Richard
>
> Regards,
> Shawn
>
> > ---
> > arch/arm/mach-imx/clock-imx6q.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
> > index 039a7ab..2525380 100644
> > --- a/arch/arm/mach-imx/clock-imx6q.c
> > +++ b/arch/arm/mach-imx/clock-imx6q.c
> > @@ -1911,6 +1911,7 @@ static struct clk_lookup lookups[] = {
> > _REGISTER_CLOCK(NULL, "gpmi_io_clk", gpmi_io_clk),
> > _REGISTER_CLOCK(NULL, "usboh3_clk", usboh3_clk),
> > _REGISTER_CLOCK(NULL, "sata_clk", sata_clk),
> > + _REGISTER_CLOCK(NULL, "cpu_clk", arm_clk),
> > };
> >
> > int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
> > --
> > 1.7.5.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support
2011-12-12 3:42 [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Richard Zhao
` (6 preceding siblings ...)
2011-12-12 3:42 ` [PATCH 7/7] arm/imx6q: register arm_clk to clkdev Richard Zhao
@ 2011-12-12 5:48 ` Shawn Guo
2011-12-12 5:56 ` Richard Zhao
7 siblings, 1 reply; 35+ messages in thread
From: Shawn Guo @ 2011-12-12 5:48 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 11:42:25AM +0800, Richard Zhao wrote:
> - add imx6q sabrelite board support
> - add imx6q cpufreq support
>
It seems that Rob Lee is also working on imx6q cpufreq. We had some
talk about this. I would suggest move the existing imx cpufreq driver
into drivers/cpufreq before we start adding imx6q support. (Samsung
and Omap have already done that.)
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 35+ messages in thread* [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support
2011-12-12 5:48 ` [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support Shawn Guo
@ 2011-12-12 5:56 ` Richard Zhao
2011-12-12 10:56 ` Richard Zhao
0 siblings, 1 reply; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 5:56 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:48:14PM +0800, Shawn Guo wrote:
> On Mon, Dec 12, 2011 at 11:42:25AM +0800, Richard Zhao wrote:
> > - add imx6q sabrelite board support
> > - add imx6q cpufreq support
> >
> It seems that Rob Lee is also working on imx6q cpufreq. We had some
> talk about this. I would suggest move the existing imx cpufreq driver
> into drivers/cpufreq before we start adding imx6q support. (Samsung
> and Omap have already done that.)
yes. There might be duplicate work here.
I agree the migration. Please continue review other parts.
Rob,
Could you review this patch series too and check the fragment?
Thanks
Richard
>
> --
> Regards,
> Shawn
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 0/7] arm/imx6: add imx6q sabrelite board and imx6q cpufreq support
2011-12-12 5:56 ` Richard Zhao
@ 2011-12-12 10:56 ` Richard Zhao
0 siblings, 0 replies; 35+ messages in thread
From: Richard Zhao @ 2011-12-12 10:56 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 01:56:01PM +0800, Richard Zhao wrote:
> On Mon, Dec 12, 2011 at 01:48:14PM +0800, Shawn Guo wrote:
> > On Mon, Dec 12, 2011 at 11:42:25AM +0800, Richard Zhao wrote:
> > > - add imx6q sabrelite board support
> > > - add imx6q cpufreq support
> > >
> > It seems that Rob Lee is also working on imx6q cpufreq. We had some
> > talk about this. I would suggest move the existing imx cpufreq driver
> > into drivers/cpufreq before we start adding imx6q support. (Samsung
> > and Omap have already done that.)
> yes. There might be duplicate work here.
> I agree the migration. Please continue review other parts.
Sascha,
About cpufreq, this patch series aim to add imx6 cpufreq support. Migrating to
driver/cpufreq/ can leave to other coming patch. Is it ok for you?
Thanks
Richard
^ permalink raw reply [flat|nested] 35+ messages in thread