Skip to contentSkip to conversation

: am33xx: Add required includes to some omap/am33xx code

PATCH New Tom Rini 1 participant 3 messages Mar 14, 2013 – Mar 26, 2013

Subsystems (5)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

cover : am33xx: Add required includes to some omap/am33xx code

This patch will be required for the ti814x series as that exposed this underlying issue. The problem goes like this. On OMAP3 there is reason (at least at first glance) for having both <asm/arch/hardware.h> and <asm/arch/cpu.h> in the config file as we reference values found in both in CONFIG options. am335x_evm.h started from one of these platforms (at least in some roundabout fashion) and didn't think twice since we also reference something that's more deeply included. Along comes ti814x support which sets in <asm/arch/omap.h> NON_SECURE_SRAM_START/END based on CONFIG selection and burries most of the real choices of <asm/arch/hardware.h> in a sub-include also based on CONFIG. The good news is that only <asm/arch-am33xx/omap.h> includes values we care about, based on CONFIG and in that one file we can not #include <config.h> and get away with this implicit include.

Without this, and making <asm/arch-am33xx/omap.h> #include <config.h> we get into a loop with CONFIG_SYS_BAUDRATE_TABLE being re-defined (which both am33xx boards ought to drop their local define of anyhow) but also CONFIG_FS_FAT _not_ being set as when we evaluate the fallbacks the first part of the test is not true. This means an alternate patch would be to re-order the config files such we add our #includes near the end, rather than front of the file.

Signature · 1 line
Tom
author
#1 lore raw

PATCH 1/1 am33xx: Add required includes to some omap/am33xx code

- In arch/arm/cpu/armv7/omap-common/timer.c, drivers/mtd/nand/omap_gpmc.c and drivers/net/cpsw.c add #include files that the driver needs but had been relying on <config.h> to bring in.
- In arch/arm/cpu/armv7/omap-common/lowlevel_init.S add <config.h>
- In am335x_evm.h and pcm051.h don't globally include <asm/arch/hardware.h> and <asm/arch/cpu.h> but just <asm/arch/omap.h> as that is the only include which defines things the config uses.

Cc Lars Poeschel <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |    1 +
 arch/arm/cpu/armv7/omap-common/timer.c         |    1 +
 drivers/mtd/nand/omap_gpmc.c                   |    1 +
 drivers/net/cpsw.c                             |    1 +
 include/configs/am335x_evm.h                   |    3 +--
 include/configs/pcm051.h                       |    3 +--
 6 files changed, 6 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/omap-common/lowlevel_init.S +1 -0
index 3581077..b933fe8 100644
@@ -26,6 +26,7 @@
  * MA 02111-1307 USA
  */
 
+#include <config.h>
 #include <asm/arch/omap.h>
 #include <asm/arch/spl.h>
 #include <linux/linkage.h>
arch/arm/cpu/armv7/omap-common/timer.c +1 -0
index 36bea5f..507f687 100644
@@ -34,6 +34,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/arch/cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/mtd/nand/omap_gpmc.c +1 -0
index cee394e..bbf5443 100644
@@ -25,6 +25,7 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <asm/arch/mem.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/omap_gpmc.h>
 #include <linux/mtd/nand_ecc.h>
 #include <linux/compiler.h>
drivers/net/cpsw.c +1 -0
index db04795..f5c5b9a 100644
@@ -24,6 +24,7 @@
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <phy.h>
+#include <asm/arch/cpu.h>
 
 #define BITMASK(bits)		(BIT(bits) - 1)
 #define PHY_REG_MASK		0x1f
include/configs/am335x_evm.h +1 -2
index 0dc2a50..06913e2 100644
@@ -18,8 +18,7 @@
 
 #define CONFIG_AM33XX
 
-#include <asm/arch/cpu.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch/omap.h>
 
 #define CONFIG_DMA_COHERENT
 #define CONFIG_DMA_COHERENT_SIZE	(1 << 20)
include/configs/pcm051.h +1 -2
index aa90ba9..f80fb00 100644
@@ -21,8 +21,7 @@
 
 #define CONFIG_AM33XX
 
-#include <asm/arch/cpu.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch/omap.h>
 
 #define CONFIG_DMA_COHERENT
 #define CONFIG_DMA_COHERENT_SIZE	(1 << 20)
Signature · 1 line
1.7.9.5
author
#2 lore raw

[U-Boot] am33xx: Add required includes to some omap/am33xx code

Quoted 10 lines · Tom Rini

- In arch/arm/cpu/armv7/omap-common/timer.c, drivers/mtd/nand/omap_gpmc.c and drivers/net/cpsw.c add #include files that the driver needs but had been relying on <config.h> to bring in.
- In arch/arm/cpu/armv7/omap-common/lowlevel_init.S add <config.h>
- In am335x_evm.h and pcm051.h don't globally include <asm/arch/hardware.h> and <asm/arch/cpu.h> but just <asm/arch/omap.h> as that is the only include which defines things the config uses.

Cc Lars Poeschel <[email protected]>

Applied to u-boot-ti/master (and already pulled into u-boot-arm), thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130326/73d41790/attachment.pgp>