diff mbox

[U-Boot,3/3] ARM: mx6: use common CPU errata config options

Message ID 1361917709-11536-3-git-send-email-swarren@wwwdotorg.org
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Stephen Warren Feb. 26, 2013, 10:28 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Now that U-Boot has common CONFIG_ options to work around some ARM CPU
errata, enable the relevant options on MX6, and remove the custom
lowlevel_init.S, since it's just duplicated code now.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/cpu/armv7/Makefile            |    2 +-
 arch/arm/cpu/armv7/mx6/Makefile        |    1 -
 arch/arm/cpu/armv7/mx6/lowlevel_init.S |   35 --------------------------------
 arch/arm/cpu/armv7/mx6/soc.c           |    4 ++++
 include/configs/mx6_common.h           |   23 +++++++++++++++++++++
 include/configs/mx6qarm2.h             |    3 +++
 include/configs/mx6qsabre_common.h     |    3 +++
 include/configs/mx6qsabrelite.h        |    3 +++
 8 files changed, 37 insertions(+), 37 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/mx6/lowlevel_init.S
 create mode 100644 include/configs/mx6_common.h

Comments

Fabio Estevam Feb. 27, 2013, 12:15 a.m. UTC | #1
On Tue, Feb 26, 2013 at 7:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Now that U-Boot has common CONFIG_ options to work around some ARM CPU
> errata, enable the relevant options on MX6, and remove the custom
> lowlevel_init.S, since it's just duplicated code now.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Looks good, thanks.

Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Liu Hui-R64343 Feb. 27, 2013, 2:44 a.m. UTC | #2
>-----Original Message-----
>From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de]
>On Behalf Of Stephen Warren
>Sent: Wednesday, February 27, 2013 6:28 AM
>To: Tom Warren
>Cc: u-boot@lists.denx.de; Stephen Warren
>Subject: [U-Boot] [PATCH 3/3] ARM: mx6: use common CPU errata config
>options
>
>From: Stephen Warren <swarren@nvidia.com>
>
>Now that U-Boot has common CONFIG_ options to work around some ARM
>CPU errata, enable the relevant options on MX6, and remove the custom
>lowlevel_init.S, since it's just duplicated code now.
>
>Signed-off-by: Stephen Warren <swarren@nvidia.com>
>---
> arch/arm/cpu/armv7/Makefile            |    2 +-
> arch/arm/cpu/armv7/mx6/Makefile        |    1 -
> arch/arm/cpu/armv7/mx6/lowlevel_init.S |   35 --------------------------------
> arch/arm/cpu/armv7/mx6/soc.c           |    4 ++++
> include/configs/mx6_common.h           |   23 +++++++++++++++++++++
> include/configs/mx6qarm2.h             |    3 +++
> include/configs/mx6qsabre_common.h     |    3 +++
> include/configs/mx6qsabrelite.h        |    3 +++
> 8 files changed, 37 insertions(+), 37 deletions(-)  delete mode 100644
>arch/arm/cpu/armv7/mx6/lowlevel_init.S
> create mode 100644 include/configs/mx6_common.h

Acked-by: Jason Liu <r64343@freescale.com>

>
>diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
>index ee8c2b3..4668b3c 100644
>--- a/arch/arm/cpu/armv7/Makefile
>+++ b/arch/arm/cpu/armv7/Makefile
>@@ -32,7 +32,7 @@ COBJS	+= cache_v7.o
> COBJS	+= cpu.o
> COBJS	+= syslib.o
>
>-ifneq
>($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_T
>EGRA),)
>+ifneq
>+($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_
>TEGRA)$(C
>+ONFIG_MX6),)
> SOBJS	+= lowlevel_init.o
> endif
>
>diff --git a/arch/arm/cpu/armv7/mx6/Makefile
>b/arch/arm/cpu/armv7/mx6/Makefile index cbce411..4f9ca68 100644
>--- a/arch/arm/cpu/armv7/mx6/Makefile
>+++ b/arch/arm/cpu/armv7/mx6/Makefile
>@@ -28,7 +28,6 @@ include $(TOPDIR)/config.mk
> LIB	= $(obj)lib$(SOC).o
>
> COBJS	= soc.o clock.o
>-SOBJS   = lowlevel_init.o
>
> SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
>diff --git a/arch/arm/cpu/armv7/mx6/lowlevel_init.S
>b/arch/arm/cpu/armv7/mx6/lowlevel_init.S
>deleted file mode 100644
>index 7b60ca7..0000000

[..]
>--
>1.7.10.4
>
>_______________________________________________
>U-Boot mailing list
>U-Boot@lists.denx.de
>http://lists.denx.de/mailman/listinfo/u-boot
Stefano Babic March 7, 2013, 5:24 p.m. UTC | #3
On 26/02/2013 23:28, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Now that U-Boot has common CONFIG_ options to work around some ARM CPU
> errata, enable the relevant options on MX6, and remove the custom
> lowlevel_init.S, since it's just duplicated code now.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---

Hi Stephen,

applied to u-boot-imx. It is not effective until Alber apply 1/3, but it
does not hurt.

Best regards,
Stefano Babic
Stephen Warren March 7, 2013, 7:19 p.m. UTC | #4
On 03/07/2013 10:24 AM, Stefano Babic wrote:
> On 26/02/2013 23:28, Stephen Warren wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Now that U-Boot has common CONFIG_ options to work around some ARM CPU
>> errata, enable the relevant options on MX6, and remove the custom
>> lowlevel_init.S, since it's just duplicated code now.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
> 
> Hi Stephen,
> 
> applied to u-boot-imx. It is not effective until Alber apply 1/3, but it
> does not hurt.

If you do that, then won't the imx6-specific WAR code be removed before
the generic implementation is added, so that there will be a period
where the WAR won't be enabled? I suppose if you send your pull request
after Albert has merged the generic implementation there won't be an
issue in u-boot-arm, but until u-boot-imx picks up the latest
u-boot-arm, the issue will exist there.
Stefano Babic March 8, 2013, 8:12 a.m. UTC | #5
On 07/03/2013 20:19, Stephen Warren wrote:
> On 03/07/2013 10:24 AM, Stefano Babic wrote:
>> On 26/02/2013 23:28, Stephen Warren wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> Now that U-Boot has common CONFIG_ options to work around some ARM CPU
>>> errata, enable the relevant options on MX6, and remove the custom
>>> lowlevel_init.S, since it's just duplicated code now.
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>> ---
>>
>> Hi Stephen,
>>
>> applied to u-boot-imx. It is not effective until Alber apply 1/3, but it
>> does not hurt.
> 
> If you do that, then won't the imx6-specific WAR code be removed before
> the generic implementation is added, so that there will be a period
> where the WAR won't be enabled?

You're right - there is a period where it is not enabled. I hope it is
quite short, and I will track this patchset to check when flows into
u-boot-arm.

> I suppose if you send your pull request
> after Albert has merged the generic implementation there won't be an
> issue in u-boot-arm, but until u-boot-imx picks up the latest
> u-boot-arm, the issue will exist there.

Right - there is some "grey zone" when a patchset belongs to different
areas. My supposition (please correct if I am wrong) is that this
patchset is ready to be merged and will not require another iteration,
and I do not want to delay it while expecting something from my side.
When Albert will pick it up the rest, everything will be fine.

Stefano
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index ee8c2b3..4668b3c 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -32,7 +32,7 @@  COBJS	+= cache_v7.o
 COBJS	+= cpu.o
 COBJS	+= syslib.o
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA),)
+ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6),)
 SOBJS	+= lowlevel_init.o
 endif
 
diff --git a/arch/arm/cpu/armv7/mx6/Makefile b/arch/arm/cpu/armv7/mx6/Makefile
index cbce411..4f9ca68 100644
--- a/arch/arm/cpu/armv7/mx6/Makefile
+++ b/arch/arm/cpu/armv7/mx6/Makefile
@@ -28,7 +28,6 @@  include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(SOC).o
 
 COBJS	= soc.o clock.o
-SOBJS   = lowlevel_init.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/arch/arm/cpu/armv7/mx6/lowlevel_init.S b/arch/arm/cpu/armv7/mx6/lowlevel_init.S
deleted file mode 100644
index 7b60ca7..0000000
--- a/arch/arm/cpu/armv7/mx6/lowlevel_init.S
+++ /dev/null
@@ -1,35 +0,0 @@ 
-/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-.section ".text.init", "x"
-
-#include <linux/linkage.h>
-
-.macro init_arm_errata
-	/* ARM erratum ID #743622 */
-	mrc	p15, 0, r10, c15, c0, 1		/* read diagnostic register */
-	orr	r10, r10, #1 << 6		/* set bit #6 */
-	/* ARM erratum ID #751472 */
-	orr	r10, r10, #1 << 11		/* set bit #11 */
-	mcr	p15, 0, r10, c15, c0, 1		/* write diagnostic register */
-.endm
-
-ENTRY(lowlevel_init)
-	init_arm_errata
-	mov pc, lr
-ENDPROC(lowlevel_init)
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index a8aad5d..8176249 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -193,3 +193,7 @@  const struct boot_mode soc_boot_modes[] = {
 	{"esdhc4",	MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
 	{NULL,		0},
 };
+
+void s_init(void)
+{
+}
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
new file mode 100644
index 0000000..b333937
--- /dev/null
+++ b/include/configs/mx6_common.h
@@ -0,0 +1,23 @@ 
+/*
+ * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MX6_COMMON_H
+#define __MX6_COMMON_H
+
+#define CONFIG_ARM_ERRATA_743622
+#define CONFIG_ARM_ERRATA_751472
+
+#endif
diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
index 138e460..bd52cde 100644
--- a/include/configs/mx6qarm2.h
+++ b/include/configs/mx6qarm2.h
@@ -24,6 +24,9 @@ 
 
 #define CONFIG_MX6
 #define CONFIG_MX6Q
+
+#include "mx6_common.h"
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
diff --git a/include/configs/mx6qsabre_common.h b/include/configs/mx6qsabre_common.h
index d76357c..b634997 100644
--- a/include/configs/mx6qsabre_common.h
+++ b/include/configs/mx6qsabre_common.h
@@ -19,6 +19,9 @@ 
 
 #define CONFIG_MX6
 #define CONFIG_MX6Q
+
+#include "mx6_common.h"
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index 752f098..682012e 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -24,6 +24,9 @@ 
 
 #define CONFIG_MX6
 #define CONFIG_MX6Q
+
+#include "mx6_common.h"
+
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO