Browse Source

Merge git://git.denx.de/u-boot-pxa

Tom Rini 9 years ago
parent
commit
7d31c6ab83

+ 1 - 0
arch/arm/cpu/pxa/Makefile

@@ -13,3 +13,4 @@ obj-$(CONFIG_CPU_PXA27X)	+= pxa2xx.o
 obj-y	+= cpuinfo.o
 obj-y	+= timer.o
 obj-y	+= usb.o
+obj-y	+= relocate.o

+ 2 - 2
arch/arm/cpu/pxa/pxa2xx.c

@@ -10,11 +10,11 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <common.h>
+#include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <command.h>
-#include <common.h>
-#include <asm/arch/pxa-regs.h>
 
 /* Flush I/D-cache */
 static void cache_flush(void)

+ 23 - 0
arch/arm/cpu/pxa/relocate.S

@@ -0,0 +1,23 @@
+/*
+ *  relocate - PXA270 vector relocation
+ *
+ *  Copyright (c) 2013  Albert ARIBAUD <albert.u.boot@aribaud.net>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <linux/linkage.h>
+
+/*
+ * The PXA SoC is very specific with respect to exceptions: it
+ * does not provide RAM at the high vectors address (0xFFFF0000),
+ * thus only the low address (0x00000000) is useable; but that is
+ * in ROM, so let's avoid relocating the vectors.
+ */
+	.section	.text.relocate_vectors,"ax",%progbits
+
+ENTRY(relocate_vectors)
+
+	bx	lr
+
+ENDPROC(relocate_vectors)

+ 2 - 69
arch/arm/cpu/pxa/timer.c

@@ -6,80 +6,13 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#include <asm/arch/pxa-regs.h>
-#include <asm/io.h>
 #include <common.h>
-#include <div64.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define	TIMER_LOAD_VAL	0xffffffff
-
-#define	timestamp	(gd->arch.tbl)
-#define	lastinc		(gd->arch.lastinc)
-
-#if defined(CONFIG_CPU_PXA27X) || defined(CONFIG_CPU_MONAHANS)
-#define	TIMER_FREQ_HZ	3250000
-#elif defined(CONFIG_CPU_PXA25X)
-#define	TIMER_FREQ_HZ	3686400
-#else
-#error "Timer frequency unknown - please config PXA CPU type"
-#endif
-
-static unsigned long long tick_to_time(unsigned long long tick)
-{
-	return lldiv(tick * CONFIG_SYS_HZ, TIMER_FREQ_HZ);
-}
-
-static unsigned long long us_to_tick(unsigned long long us)
-{
-	return lldiv(us * TIMER_FREQ_HZ, 1000000);
-}
-
 int timer_init(void)
 {
-	writel(0, OSCR);
+	writel(0, CONFIG_SYS_TIMER_COUNTER);
 	return 0;
 }
-
-unsigned long long get_ticks(void)
-{
-	/* Current tick value */
-	uint32_t now = readl(OSCR);
-
-	if (now >= lastinc) {
-		/*
-		 * Normal mode (non roll)
-		 * Move stamp forward with absolute diff ticks
-		 */
-		timestamp += (now - lastinc);
-	} else {
-		/* We have rollover of incrementer */
-		timestamp += (TIMER_LOAD_VAL - lastinc) + now;
-	}
-
-	lastinc = now;
-	return timestamp;
-}
-
-ulong get_timer(ulong base)
-{
-	return tick_to_time(get_ticks()) - base;
-}
-
-void __udelay(unsigned long usec)
-{
-	unsigned long long tmp;
-	ulong tmo;
-
-	tmo = us_to_tick(usec);
-	tmp = get_ticks() + tmo;	/* get current timestamp */
-
-	while (get_ticks() < tmp)	/* loop till event */
-		 /*NOP*/;
-}
-
-ulong get_tbclk(void)
-{
-	return TIMER_FREQ_HZ;
-}

+ 25 - 0
arch/arm/include/asm/arch-pxa/config.h

@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2014 Andrew Ruder <andrew.ruder@elecsyscorp.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARM_PXA_CONFIG_
+#define _ASM_ARM_PXA_CONFIG_
+
+#include <asm/arch/pxa-regs.h>
+
+/*
+ * Generic timer support
+ */
+#if defined(CONFIG_CPU_PXA27X) || defined(CONFIG_CPU_MONAHANS)
+#define	CONFIG_SYS_TIMER_RATE	3250000
+#elif defined(CONFIG_CPU_PXA25X)
+#define	CONFIG_SYS_TIMER_RATE	3686400
+#else
+#error "Timer frequency unknown - please config PXA CPU type"
+#endif
+
+#define CONFIG_SYS_TIMER_COUNTER	OSCR
+
+#endif /* _ASM_ARM_PXA_CONFIG_ */

+ 4 - 1
arch/arm/include/asm/config.h

@@ -19,7 +19,10 @@
 #include <asm/arch-fsl-lsch3/config.h>
 #endif
 
-#ifdef CONFIG_LS102XA
+#if defined(CONFIG_LS102XA) || \
+	defined(CONFIG_CPU_PXA27X) || \
+	defined(CONFIG_CPU_MONAHANS) || \
+	defined(CONFIG_CPU_PXA25X)
 #include <asm/arch/config.h>
 #endif
 

+ 3 - 5
drivers/mmc/pxa_mmc_gen.c

@@ -6,15 +6,13 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#include <config.h>
 #include <common.h>
-#include <malloc.h>
-
-#include <mmc.h>
-#include <asm/errno.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/regs-mmc.h>
+#include <asm/errno.h>
 #include <asm/io.h>
+#include <malloc.h>
+#include <mmc.h>
 
 /* PXAMMC Generic default config for various CPUs */
 #if defined(CONFIG_CPU_PXA25X)

+ 2 - 2
drivers/serial/serial_pxa.c

@@ -18,12 +18,12 @@
  */
 
 #include <common.h>
-#include <watchdog.h>
-#include <serial.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/regs-uart.h>
 #include <asm/io.h>
 #include <linux/compiler.h>
+#include <serial.h>
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 

+ 2 - 3
drivers/usb/gadget/pxa27x_udc.c

@@ -10,11 +10,10 @@
 
 
 #include <common.h>
-#include <config.h>
-#include <asm/byteorder.h>
-#include <usbdevice.h>
 #include <asm/arch/hardware.h>
+#include <asm/byteorder.h>
 #include <asm/io.h>
+#include <usbdevice.h>
 #include <usb/pxa27x_udc.h>
 #include <usb/udc.h>
 

+ 4 - 5
drivers/video/pxa_lcd.c

@@ -11,14 +11,13 @@
 /* ** HEADER FILES							*/
 /************************************************************************/
 
-#include <config.h>
 #include <common.h>
-#include <stdarg.h>
-#include <linux/types.h>
-#include <stdio_dev.h>
-#include <lcd.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
+#include <lcd.h>
+#include <linux/types.h>
+#include <stdarg.h>
+#include <stdio_dev.h>
 
 /* #define DEBUG */
 

+ 26 - 0
include/configs/colibri_pxa270.h

@@ -19,6 +19,9 @@
 /* Avoid overwriting factory configuration block */
 #define CONFIG_BOARD_SIZE_LIMIT		0x40000
 
+/* We will never enable dcache because we have to setup MMU first */
+#define CONFIG_SYS_DCACHE_OFF
+
 /*
  * Environment settings
  */
@@ -56,6 +59,25 @@
 #define	CONFIG_CMD_MMC
 #define	CONFIG_CMD_USB
 
+/* I2C support */
+#ifdef CONFIG_SYS_I2C
+#define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C_PXA
+#define CONFIG_PXA_STD_I2C
+#define CONFIG_PXA_PWR_I2C
+#define CONFIG_SYS_I2C_SPEED		100000
+#endif
+
+/* LCD support */
+#ifdef CONFIG_LCD
+#define CONFIG_PXA_LCD
+#define CONFIG_PXA_VGA
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES	10
+#define CONFIG_CMD_BMP
+#define CONFIG_LCD_LOGO
+#endif
+
 /*
  * Networking Configuration
  */
@@ -122,16 +144,20 @@
  */
 #ifdef	CONFIG_CMD_FLASH
 #define	PHYS_FLASH_1			0x00000000	/* Flash Bank #1 */
+#define	PHYS_FLASH_SIZE			0x02000000	/* 32 MB */
 #define	CONFIG_SYS_FLASH_BASE		PHYS_FLASH_1
 
 #define	CONFIG_SYS_FLASH_CFI
 #define	CONFIG_FLASH_CFI_DRIVER		1
+#define	CONFIG_SYS_FLASH_CFI_WIDTH      FLASH_CFI_32BIT
 
 #define	CONFIG_SYS_MAX_FLASH_SECT	(4 + 255)
 #define	CONFIG_SYS_MAX_FLASH_BANKS	1
 
 #define	CONFIG_SYS_FLASH_ERASE_TOUT	(25 * CONFIG_SYS_HZ)
 #define	CONFIG_SYS_FLASH_WRITE_TOUT	(25 * CONFIG_SYS_HZ)
+#define	CONFIG_SYS_FLASH_LOCK_TOUT	(25 * CONFIG_SYS_HZ)
+#define	CONFIG_SYS_FLASH_UNLOCK_TOUT	(25 * CONFIG_SYS_HZ)
 
 #define	CONFIG_SYS_FLASH_USE_BUFFER_WRITE	1
 #define	CONFIG_SYS_FLASH_PROTECTION		1

+ 0 - 1
include/configs/palmtreo680.h

@@ -67,7 +67,6 @@
 #define CONFIG_PXA_LCD
 #define CONFIG_ACX544AKN
 #define CONFIG_LCD_LOGO
-#define CONFIG_SYS_LCD_PXA_NO_L_BIAS /* don't configure GPIO77 as L_BIAS */
 #define LCD_BPP LCD_COLOR16
 #define CONFIG_FB_ADDR 0x5c000000    /* internal SRAM */
 #define CONFIG_CMD_BMP