Skip to contentSkip to conversation

integratorap: split pci support

RFC PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 6 messages May 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/6 integratorap: split pci support

---
 board/armltd/integratorap/Makefile                 |   19 +-
 board/armltd/integratorap/integratorap.c           |  946 ++++++--------------
 .../armltd/integratorap/{integratorap.c => pci.c}  |  262 +------
 3 files changed, 302 insertions(+), 925 deletions(-)
 rewrite board/armltd/integratorap/integratorap.c (63%)
 rename board/armltd/integratorap/{integratorap.c => pci.c} (69%)
board/armltd/integratorap/Makefile +11 -8
index 79f501a..a6193c7 100644
@@ -29,18 +29,21 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= integratorap.o flash.o
-SOBJS	:= lowlevel_init.o
+SOBJS-y	:= lowlevel_init.o
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
+COBJS-y	:= integratorap.o
+COBJS-y	+= flash.o
+COBJS-$(CONFIG_PCI) += pci.o
 
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+COBJS	:= $(addprefix $(obj),$(COBJS-y))
+SOBJS	:= $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):	$(obj).depend $(COBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(COBJS) $(SOBJS)
 
 clean:
-	rm -f $(SOBJS) $(OBJS)
+	rm -f $(SOBJS) $(COBJS)
 
 distclean:	clean
 	rm -f $(LIB) core *.bak $(obj).depend
board/armltd/integratorap/integratorap.c +290 -656

946 lines not on this page · raw message

board/armltd/integratorap/pci.c renamed from board/armltd/integratorap/integratorap.c +1 -261

284 lines not on this page · raw message

Signature · 1 line
1.6.1.3
#1 lore raw

RFC PATCH 2/6 integratorap: split timer support

---
 board/armltd/integratorap/Makefile       |    1 +
 board/armltd/integratorap/integratorap.c |  135 -----------------------
 board/armltd/integratorap/timer.c        |  171 ++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+), 135 deletions(-)
 create mode 100644 board/armltd/integratorap/timer.c
board/armltd/integratorap/Makefile +1 -0
index a6193c7..1af37f3 100644
@@ -34,6 +34,7 @@ SOBJS-y	:= lowlevel_init.o
 COBJS-y	:= integratorap.o
 COBJS-y	+= flash.o
 COBJS-$(CONFIG_PCI) += pci.o
+COBJS-y += timer.o
 
 SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 COBJS	:= $(addprefix $(obj),$(COBJS-y))
board/armltd/integratorap/integratorap.c +0 -135

141 lines not on this page · raw message

board/armltd/integratorap/timer.c new file +171 -0

171 lines not on this page · raw message

Signature · 1 line
1.6.1.3
#2 lore raw

RFC PATCH 3/6 integratorcp: split timer support

---
 board/armltd/integratorcp/Makefile                 |    5 +-
 board/armltd/integratorcp/integratorcp.c           |  140 --------------------
 .../integratorcp/{integratorcp.c => timer.c}       |  103 --------------
 3 files changed, 4 insertions(+), 244 deletions(-)
 copy board/armltd/integratorcp/{integratorcp.c => timer.c} (68%)
board/armltd/integratorcp/Makefile +4 -1
index 92a1a07..5e3c646 100644
@@ -25,9 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= integratorcp.o flash.o
 SOBJS	:= lowlevel_init.o
 
+COBJS	:= integratorcp.o
+COBJS	+= flash.o
+COBJS	+= timer.o
+
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
board/armltd/integratorcp/integratorcp.c +0 -140

149 lines not on this page · raw message

board/armltd/integratorcp/timer.c renamed from board/armltd/integratorcp/integratorcp.c +0 -103

109 lines not on this page · raw message

Signature · 1 line
1.6.1.3
#3 lore raw

RFC PATCH 4/6 integratorap/cp/versatile: remove non used functions

---
 board/armltd/integratorap/integratorap.c |   28 ----------------------------
 board/armltd/integratorcp/integratorcp.c |   21 ---------------------
 board/armltd/versatile/versatile.c       |    7 -------
 3 files changed, 0 insertions(+), 56 deletions(-)
board/armltd/integratorap/integratorap.c +0 -28
index b20b129..f58956e 100644
@@ -38,8 +38,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void flash__init (void);
-void ether__init (void);
 void peripheral_power_enable (void);
 
 #if defined(CONFIG_SHOW_BOOT_PROGRESS)
@@ -51,13 +49,6 @@ void show_boot_progress(int progress)
 
 #define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
 
-static inline void delay (unsigned long loops)
-{
-	__asm__ volatile ("1:\n"
-		"subs %0, %1, #1\n"
-		"bne 1b":"=r" (loops):"0" (loops));
-}
-
 /*
  * Miscellaneous platform dependent initialisations
  */
@@ -79,11 +70,9 @@ extern void cm_remap(void);
 
 	icache_enable ();
 
-	flash__init ();
 	return 0;
 }
 
-
 int misc_init_r (void)
 {
 #ifdef CONFIG_PCI
@@ -93,23 +82,6 @@ int misc_init_r (void)
 	return (0);
 }
 
-
-/******************************
- Routine:
- Description:
-******************************/
-void flash__init (void)
-{
-}
-/*************************************************************
- Routine:ether__init
- Description: take the Ethernet controller out of reset and wait
-			   for the EEPROM load to complete.
-*************************************************************/
-void ether__init (void)
-{
-}
-
 /******************************
  Routine:
  Description:
board/armltd/integratorcp/integratorcp.c +0 -21
index 16620bb..5897147 100644
@@ -37,8 +37,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void flash__init (void);
-void ether__init (void);
 void peripheral_power_enable (void);
 
 #if defined(CONFIG_SHOW_BOOT_PROGRESS)
@@ -71,12 +69,9 @@ extern void cm_remap(void);
 
 	icache_enable ();
 
-	flash__init ();
-	ether__init ();
 	return 0;
 }
 
-
 int misc_init_r (void)
 {
 	setenv("verify", "n");
@@ -87,22 +82,6 @@ int misc_init_r (void)
  Routine:
  Description:
 ******************************/
-void flash__init (void)
-{
-}
-/*************************************************************
- Routine:ether__init
- Description: take the Ethernet controller out of reset and wait
-	      for the EEPROM load to complete.
-*************************************************************/
-void ether__init (void)
-{
-}
-
-/******************************
- Routine:
- Description:
-******************************/
 int dram_init (void)
 {
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
board/armltd/versatile/versatile.c +0 -7
index 0f35caa..197bc89 100644
@@ -46,13 +46,6 @@ void show_boot_progress(int progress)
 
 #define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
 
-static inline void delay (unsigned long loops)
-{
-	__asm__ volatile ("1:\n"
-		"subs %0, %1, #1\n"
-		"bne 1b":"=r" (loops):"0" (loops));
-}
-
 /*
  * Miscellaneous platform dependent initialisations
  */
Signature · 1 line
1.6.1.3
#4 lore raw

RFC PATCH 5/6 integratorap/cp: use cfi driver

---
 board/armltd/integratorap/Makefile |    1 -
 board/armltd/integratorap/flash.c  |  473 ------------------------------
 board/armltd/integratorcp/Makefile |    1 -
 board/armltd/integratorcp/flash.c  |  564 ------------------------------------
 include/configs/integratorap.h     |    8 +-
 include/configs/integratorcp.h     |    4 +-
 6 files changed, 7 insertions(+), 1044 deletions(-)
 delete mode 100644 board/armltd/integratorap/flash.c
 delete mode 100644 board/armltd/integratorcp/flash.c
board/armltd/integratorap/Makefile +0 -1
index 1af37f3..da82f5c 100644
@@ -32,7 +32,6 @@ LIB	= $(obj)lib$(BOARD).a
 SOBJS-y	:= lowlevel_init.o
 
 COBJS-y	:= integratorap.o
-COBJS-y	+= flash.o
 COBJS-$(CONFIG_PCI) += pci.o
 COBJS-y += timer.o
 
board/armltd/integratorap/flash.c deleted +0 -473

473 lines not on this page · raw message

board/armltd/integratorcp/Makefile +0 -1
index 5e3c646..76a85d9 100644
@@ -28,7 +28,6 @@ LIB	= $(obj)lib$(BOARD).a
 SOBJS	:= lowlevel_init.o
 
 COBJS	:= integratorcp.o
-COBJS	+= flash.o
 COBJS	+= timer.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
board/armltd/integratorcp/flash.c deleted +0 -564

564 lines not on this page · raw message

include/configs/integratorap.h +4 -4
index 09270ff..e0e8258 100644
@@ -122,21 +122,21 @@
 #define PHYS_SDRAM_1		0x00000000	/* SDRAM Bank #1 */
 #define PHYS_SDRAM_1_SIZE	0x02000000	/* 32 MB */
 
-#define CONFIG_SYS_FLASH_BASE		0x24000000
+#define CONFIG_SYS_FLASH_BASE	0x24000000
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
+#define CONFIG_SYS_FLASH_CFI		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #define CONFIG_ENV_IS_NOWHERE
 #define CONFIG_SYS_MAX_FLASH_BANKS	1		/* max number of memory banks */
-#define PHYS_FLASH_SIZE		0x01000000	/* 16MB */
 /* timeout values are in ticks */
 #define CONFIG_SYS_FLASH_ERASE_TOUT	(2*CONFIG_SYS_HZ)	/* Timeout for Flash Erase */
 #define CONFIG_SYS_FLASH_WRITE_TOUT	(2*CONFIG_SYS_HZ)	/* Timeout for Flash Write */
 #define CONFIG_SYS_MAX_FLASH_SECT	128
-#define CONFIG_ENV_SIZE		32768
+#define CONFIG_ENV_SIZE			32768
 
-#define PHYS_FLASH_1		(CONFIG_SYS_FLASH_BASE)
 
 /*-----------------------------------------------------------------------
  * PCI definitions
include/configs/integratorcp.h +3 -1
index b4219d0..e38d569 100644
@@ -155,9 +155,11 @@ SIB at Block62 End Block62 address 0x24f80000
 
  */
 #define CONFIG_SYS_FLASH_BASE		0x24000000
+#define CONFIG_SYS_FLASH_CFI		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #define CONFIG_SYS_MAX_FLASH_SECT	64
 #define CONFIG_SYS_MAX_FLASH_BANKS	1		/* max number of memory banks */
-#define PHYS_FLASH_SIZE		0x01000000	/* 16MB */
+#define PHYS_FLASH_SIZE			0x01000000	/* 16MB */
 #define CONFIG_SYS_FLASH_ERASE_TOUT	(2*CONFIG_SYS_HZ)	/* Timeout for Flash Erase */
 #define CONFIG_SYS_FLASH_WRITE_TOUT	(2*CONFIG_SYS_HZ)	/* Timeout for Flash Write */
 
Signature · 1 line
1.6.1.3
#5 lore raw

RFC PATCH 6/6 integrator: merge integratorap and integratorcp

---
 Makefile                                           |    4 +-
 board/armltd/integrator/.gitignore                 |    5 +
 board/armltd/{integratorap => integrator}/Makefile |    4 +-
 board/armltd/integrator/config.mk                  |    7 +
 .../integratorap.c => integrator/integrator.c}     |   10 +-
 .../{integratorap => integrator}/lowlevel_init.S   |    0
 board/armltd/{integratorap => integrator}/pci.c    |    0
 board/armltd/integrator/split_by_variant.sh        |  239 ++++++++++++++++++++
 board/armltd/{integratorcp => integrator}/timer.c  |   67 ++++--
 .../u-boot.lds.template                            |    0
 board/armltd/integratorap/config.mk                |   11 -
 board/armltd/integratorap/split_by_variant.sh      |  131 -----------
 board/armltd/integratorap/timer.c                  |  171 --------------
 board/armltd/integratorcp/Makefile                 |   53 -----
 board/armltd/integratorcp/config.mk                |   11 -
 board/armltd/integratorcp/integratorcp.c           |  118 ----------
 board/armltd/integratorcp/lowlevel_init.S          |  214 ------------------
 board/armltd/integratorcp/split_by_variant.sh      |  114 ----------
 board/armltd/integratorcp/u-boot.lds.template      |   53 -----
 19 files changed, 310 insertions(+), 902 deletions(-)
 create mode 100644 board/armltd/integrator/.gitignore
 rename board/armltd/{integratorap => integrator}/Makefile (95%)
 create mode 100644 board/armltd/integrator/config.mk
 rename board/armltd/{integratorap/integratorap.c => integrator/integrator.c} (93%)
 rename board/armltd/{integratorap => integrator}/lowlevel_init.S (100%)
 rename board/armltd/{integratorap => integrator}/pci.c (100%)
 create mode 100755 board/armltd/integrator/split_by_variant.sh
 rename board/armltd/{integratorcp => integrator}/timer.c (76%)
 rename board/armltd/{integratorap => integrator}/u-boot.lds.template (100%)
 delete mode 100644 board/armltd/integratorap/config.mk
 delete mode 100755 board/armltd/integratorap/split_by_variant.sh
 delete mode 100644 board/armltd/integratorap/timer.c
 delete mode 100644 board/armltd/integratorcp/Makefile
 delete mode 100644 board/armltd/integratorcp/config.mk
 delete mode 100644 board/armltd/integratorcp/integratorcp.c
 delete mode 100644 board/armltd/integratorcp/lowlevel_init.S
 delete mode 100755 board/armltd/integratorcp/split_by_variant.sh
 delete mode 100644 board/armltd/integratorcp/u-boot.lds.template
Makefile +2 -2
index 8a0784c..535b556 100644
@@ -2764,7 +2764,7 @@ ap720t_config		\
 ap920t_config		\
 ap926ejs_config		\
 ap946es_config: unconfig
-	@board/armltd/integratorap/split_by_variant.sh $@
+	@board/armltd/integrator/split_by_variant.sh ap $@
 
 integratorcp_config	\
 cp_config		\
@@ -2776,7 +2776,7 @@ cp966_config		\
 cp922_config		\
 cp922_XA10_config	\
 cp1026_config: unconfig
-	@board/armltd/integratorcp/split_by_variant.sh $@
+	@board/armltd/integrator/split_by_variant.sh cp $@
 
 davinci_dvevm_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs dvevm davinci davinci
board/armltd/integrator/.gitignore new file +5 -0
new file mode 100644
index 0000000..8a8c3b8
@@ -0,0 +1,5 @@
+#
+# Generated files
+#
+
+/u-boot.lds
board/armltd/integrator/Makefile renamed from board/armltd/integratorap/Makefile +2 -2
similarity index 95%
rename from board/armltd/integratorap/Makefile
rename to board/armltd/integrator/Makefile
index da82f5c..d14f6fc 100644
@@ -31,7 +31,7 @@ LIB	= $(obj)lib$(BOARD).a
 
 SOBJS-y	:= lowlevel_init.o
 
-COBJS-y	:= integratorap.o
+COBJS-y	:= integrator.o
 COBJS-$(CONFIG_PCI) += pci.o
 COBJS-y += timer.o
 
@@ -46,7 +46,7 @@ clean:
 	rm -f $(SOBJS) $(COBJS)
 
 distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
+	rm -f $(LIB) core *.bak $(obj).depend $(obj)u-boot.lds
 
 #########################################################################
 
board/armltd/integrator/config.mk new file +7 -0
new file mode 100644
index 0000000..4c56aaf
@@ -0,0 +1,7 @@
+#
+# image should be loaded at 0x01000000
+#
+
+TEXT_BASE = 0x01000000
+
+LDSCRIPT := $(obj)board/$(BOARDDIR)/u-boot.lds
board/armltd/integrator/integrator.c renamed from board/armltd/integratorap/integratorap.c +9 -1
similarity index 93%
rename from board/armltd/integratorap/integratorap.c
rename to board/armltd/integrator/integrator.c
index f58956e..b49be77 100644
@@ -34,7 +34,9 @@
  */
 
 #include <common.h>
+#ifdef CONFIG_PCI
 #include <netdev.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -56,7 +58,11 @@ void show_boot_progress(int progress)
 int board_init (void)
 {
 	/* arch number of Integrator Board */
+#ifdef CONFIG_ARCH_CINTEGRATOR
+	gd->bd->bi_arch_number = MACH_TYPE_CINTEGRATOR;
+#else
 	gd->bd->bi_arch_number = MACH_TYPE_INTEGRATOR;
+#endif
 
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = 0x00000100;
@@ -102,7 +108,7 @@ extern void dram_query(void);
 
 	/* Obtain the SDRAM size from the CM SDRAM register */
 
-	cm_reg_sdram = *(volatile ulong *)(CM_BASE + OS_SDRAM);
+	cm_reg_sdram = readl(CM_BASE + OS_SDRAM);
 	/*   Register	      SDRAM size
 	 *
 	 *   0xXXXXXXbbb000bb	 16 MB
@@ -121,7 +127,9 @@ extern void dram_query(void);
 	return 0;
 }
 
+#ifdef CONFIG_PCI
 int board_eth_init(bd_t *bis)
 {
 	return pci_eth_init(bis);
 }
+#endif
board/armltd/integrator/lowlevel_init.S renamed from board/armltd/integratorap/lowlevel_init.S +0 -0
similarity index 100%
rename from board/armltd/integratorap/lowlevel_init.S
rename to board/armltd/integrator/lowlevel_init.S
board/armltd/integrator/pci.c renamed from board/armltd/integratorap/pci.c +0 -0
similarity index 100%
rename from board/armltd/integratorap/pci.c
rename to board/armltd/integrator/pci.c
board/armltd/integrator/split_by_variant.sh new file +239 -0

239 lines not on this page · raw message

board/armltd/integrator/timer.c renamed from board/armltd/integratorcp/timer.c +46 -21

132 lines not on this page · raw message

board/armltd/integrator/u-boot.lds.template renamed from board/armltd/integratorap/u-boot.lds.template +0 -0
similarity index 100%
rename from board/armltd/integratorap/u-boot.lds.template
rename to board/armltd/integrator/u-boot.lds.template
board/armltd/integratorap/config.mk deleted +0 -11
deleted file mode 100644
index e4c5c3b..0000000
@@ -1,11 +0,0 @@
-#
-# image should be loaded at 0x01000000
-#
-
-TEXT_BASE = 0x01000000
-
-ifneq ($(OBJTREE),$(SRCTREE))
-# We are building u-boot in a separate directory, use generated
-# .lds script from OBJTREE directory.
-LDSCRIPT := $(OBJTREE)/board/$(BOARDDIR)/u-boot.lds
-endif
board/armltd/integratorap/split_by_variant.sh deleted +0 -131

131 lines not on this page · raw message

board/armltd/integratorap/timer.c deleted +0 -171

171 lines not on this page · raw message

board/armltd/integratorcp/Makefile deleted +0 -53

53 lines not on this page · raw message

board/armltd/integratorcp/config.mk deleted +0 -11
deleted file mode 100644
index e4c5c3b..0000000
@@ -1,11 +0,0 @@
-#
-# image should be loaded at 0x01000000
-#
-
-TEXT_BASE = 0x01000000
-
-ifneq ($(OBJTREE),$(SRCTREE))
-# We are building u-boot in a separate directory, use generated
-# .lds script from OBJTREE directory.
-LDSCRIPT := $(OBJTREE)/board/$(BOARDDIR)/u-boot.lds
-endif
board/armltd/integratorcp/integratorcp.c deleted +0 -118

118 lines not on this page · raw message

board/armltd/integratorcp/lowlevel_init.S deleted +0 -214

214 lines not on this page · raw message

board/armltd/integratorcp/split_by_variant.sh deleted +0 -114

114 lines not on this page · raw message

board/armltd/integratorcp/u-boot.lds.template deleted +0 -53

53 lines not on this page · raw message

Signature · 1 line
1.6.1.3