Merge git://git.denx.de/u-boot-nand-flash
diff --git a/arch/arm/cpu/pxa/Makefile b/arch/arm/cpu/pxa/Makefile
index 8cd475e..3ee08cd 100644
--- a/arch/arm/cpu/pxa/Makefile
+++ b/arch/arm/cpu/pxa/Makefile
@@ -13,3 +13,4 @@
obj-y += cpuinfo.o
obj-y += timer.o
obj-y += usb.o
+obj-y += relocate.o
diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
index 7e861e2..2f12fb9 100644
--- a/arch/arm/cpu/pxa/pxa2xx.c
+++ b/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)
diff --git a/arch/arm/cpu/pxa/relocate.S b/arch/arm/cpu/pxa/relocate.S
new file mode 100644
index 0000000..fafd4da
--- /dev/null
+++ b/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)
diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index c4717de..7c25e67 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/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;
-}
diff --git a/arch/arm/include/asm/arch-pxa/config.h b/arch/arm/include/asm/arch-pxa/config.h
new file mode 100644
index 0000000..5836945
--- /dev/null
+++ b/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_ */
diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h
index 7a34a01..22fff02 100644
--- a/arch/arm/include/asm/config.h
+++ b/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
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 3571e4f..c7a0849 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -594,7 +594,7 @@
*/
#define __read_32bit_c0_register(source, sel) \
-({ int __res; \
+({ unsigned int __res; \
if (sel == 0) \
__asm__ __volatile__( \
"mfc0\t%0, " #source "\n\t" \
@@ -676,7 +676,7 @@
* On RM7000/RM9000 these are uses to access cop0 set 1 registers
*/
#define __read_32bit_c0_ctrl_register(source) \
-({ int __res; \
+({ unsigned int __res; \
__asm__ __volatile__( \
"cfc0\t%0, " #source "\n\t" \
: "=r" (__res)); \
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index e289799..9c647aa 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -95,10 +95,10 @@
debug("## setup FDT\n");
- fdt_chosen(images->ft_addr, 1);
+ fdt_chosen(images->ft_addr);
fdt_fixup_memory_banks(images->ft_addr, &mem_start, &mem_size, 1);
fdt_fixup_ethernet(images->ft_addr);
- fdt_initrd(images->ft_addr, images->initrd_start, images->initrd_end, 1);
+ fdt_initrd(images->ft_addr, images->initrd_start, images->initrd_end);
#if defined(CONFIG_OF_BOARD_SETUP)
ft_board_setup(images->ft_addr, gd->bd);
diff --git a/drivers/mmc/pxa_mmc_gen.c b/drivers/mmc/pxa_mmc_gen.c
index 25ab0b1..19ae81d 100644
--- a/drivers/mmc/pxa_mmc_gen.c
+++ b/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)
diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
index d514004..8fbcc10 100644
--- a/drivers/serial/serial_pxa.c
+++ b/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;
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 9423555..c7b21ae 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/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>
diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index 64cef37..2799425 100644
--- a/drivers/video/pxa_lcd.c
+++ b/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 */
diff --git a/include/configs/colibri_pxa270.h b/include/configs/colibri_pxa270.h
index a1b64c6..4efc9c5 100644
--- a/include/configs/colibri_pxa270.h
+++ b/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
diff --git a/include/configs/palmtreo680.h b/include/configs/palmtreo680.h
index ffb0d1e..5ffed82 100644
--- a/include/configs/palmtreo680.h
+++ b/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