aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux
diff options
context:
space:
mode:
authorMario Schuknecht <schuknecht@dresearch-fe.de>2011-05-05 09:39:43 +0000
committerSteffen Sledz <sledz@dresearch-fe.de>2011-06-06 11:31:32 +0200
commit3dfcd3a76e60b8186b50cde3e1198f090dc1937e (patch)
treed058ee714329abe5fec1cf6310e225a8d3f9b0b5 /recipes/linux
parent0caee0e55d3aad94127c028dbb668e3bd883fb70 (diff)
downloadopenembedded-3dfcd3a76e60b8186b50cde3e1198f090dc1937e.tar.gz
linux-2.6.24: optimize flash timings (hipox machine only)
Signed-off-by: Mario Schuknecht <schuknecht@dresearch-fe.de> Acked-by: Steffen Sledz <sledz@dresearch-fe.de>
Diffstat (limited to 'recipes/linux')
-rw-r--r--recipes/linux/linux-2.6.24/hipox/hipox-nand-timing.patch63
-rw-r--r--recipes/linux/linux-2.6.24/hipox/hipox-nand-vs-nor.patch88
-rw-r--r--recipes/linux/linux_2.6.24.bb1
3 files changed, 109 insertions, 43 deletions
diff --git a/recipes/linux/linux-2.6.24/hipox/hipox-nand-timing.patch b/recipes/linux/linux-2.6.24/hipox/hipox-nand-timing.patch
new file mode 100644
index 0000000000..be3f861fef
--- /dev/null
+++ b/recipes/linux/linux-2.6.24/hipox/hipox-nand-timing.patch
@@ -0,0 +1,63 @@
+diff -Nurd linux-2.6.24.orig/drivers/mtd/maps/physmap.c linux-2.6.24/drivers/mtd/maps/physmap.c
+--- linux-2.6.24.orig/drivers/mtd/maps/physmap.c 2011-05-03 15:40:51.000000000 +0200
++++ linux-2.6.24/drivers/mtd/maps/physmap.c 2011-05-05 10:08:00.000000000 +0200
+@@ -156,7 +156,9 @@
+
+ #if defined (CONFIG_ARCH_HIPOX)
+ /* init timing for static memory controller */
++ mutex_lock(&hipox_flash_mutex);
+ writel(STATIC_BUS_FLASH_CONFIG, STATIC_CONTROL_BANK0);
++ mutex_unlock(&hipox_flash_mutex);
+ #endif /* CONFIG_ARCH_HIPOX */
+
+ printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n",
+diff -Nurd linux-2.6.24.orig/drivers/mtd/nand/hipox_nand.c linux-2.6.24/drivers/mtd/nand/hipox_nand.c
+--- linux-2.6.24.orig/drivers/mtd/nand/hipox_nand.c 2011-05-03 15:40:51.000000000 +0200
++++ linux-2.6.24/drivers/mtd/nand/hipox_nand.c 2011-05-05 10:07:52.000000000 +0200
+@@ -30,9 +30,10 @@
+
+ // the testboards ran down to a value of 4
+ //#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f3f /* slow settings, 345 ns */
+-//#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f0d /* fast settings, 70 ns */
++#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f0d /* fast settings, 70 ns; use this as default, because it works for hipox board NOR flash also */
+ //#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f09 /* ultra fast settings, 50 ns */
+-#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f04 /* warp settings, 27 ns */
++//#define STATIC_BUS_FLASH_CONFIG 0x4f1f3f04 /* warp settings, 27 ns */
++#define STATIC_BUS_FLASH_CONFIG_RW 0x41030304 /* read and write warp settings */
+
+ /*
+ * MTD structure for HydraIP board
+@@ -65,6 +66,7 @@
+ */
+ static void hipox_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+ {
++ static unsigned int bank0 = STATIC_BUS_FLASH_CONFIG;
+ struct nand_chip *this = mtd->priv;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+@@ -77,12 +79,15 @@
+ // printk("%s:%d would wait for hipox_flash_mutex\n", __func__, __LINE__);
+ mutex_lock(&hipox_flash_mutex);
+ writel(0x20000000, GPIO_A_OUTPUT_CLEAR); /* assert CS-NAND */
++ bank0 = readl(STATIC_CONTROL_BANK0);
++ writel(STATIC_BUS_FLASH_CONFIG_RW, STATIC_CONTROL_BANK0);
+ }
+ }
+ else
+ {
+ if (!(0x20000000 & readl(GPIO_A_OUTPUT_VALUE)))
+ {
++ writel(bank0, STATIC_CONTROL_BANK0);
+ writel(0x20000000, GPIO_A_OUTPUT_SET); /* deassert CS-NAND */
+ mutex_unlock(&hipox_flash_mutex);
+ // printk("%s:%d hipox_flash_mutex unlocked\n", __func__, __LINE__);
+@@ -234,7 +239,9 @@
+ return -ENOMEM;
+ }
+
++ mutex_lock(&hipox_flash_mutex);
+ writel(STATIC_BUS_FLASH_CONFIG, STATIC_CONTROL_BANK0);
++ mutex_unlock(&hipox_flash_mutex);
+
+ /* Initialize structures */
+ memset(hipox_nand_mtd, 0, sizeof(struct mtd_info));
diff --git a/recipes/linux/linux-2.6.24/hipox/hipox-nand-vs-nor.patch b/recipes/linux/linux-2.6.24/hipox/hipox-nand-vs-nor.patch
index 22dcc1bd16..8b7bc36d1e 100644
--- a/recipes/linux/linux-2.6.24/hipox/hipox-nand-vs-nor.patch
+++ b/recipes/linux/linux-2.6.24/hipox/hipox-nand-vs-nor.patch
@@ -1,18 +1,6 @@
-diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/Makefile linux-2.6.24/arch/arm/mach-hipox/Makefile
---- linux-2.6.24.orig//arch/arm/mach-hipox/Makefile 2010-01-29 11:50:34.000000000 +0100
-+++ linux-2.6.24/arch/arm/mach-hipox/Makefile 2010-01-29 11:54:02.000000000 +0100
-@@ -4,7 +4,7 @@
-
- # Object file lists.
-
--obj-y := hipox.o irq.o time.o dma.o pci.o ahb_mon.o leon.o samba_reserve.o
-+obj-y := hipox.o irq.o time.o dma.o pci.o ahb_mon.o leon.o samba_reserve.o smc.o
-
- obj-$(CONFIG_SYNOPSYS_GMAC) += gmac.o
-
-diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/hipox.c linux-2.6.24/arch/arm/mach-hipox/hipox.c
---- linux-2.6.24.orig//arch/arm/mach-hipox/hipox.c 2010-01-29 11:50:34.000000000 +0100
-+++ linux-2.6.24/arch/arm/mach-hipox/hipox.c 2010-01-29 11:51:26.000000000 +0100
+diff -Nurd linux-2.6.24.orig/arch/arm/mach-hipox/hipox.c linux-2.6.24/arch/arm/mach-hipox/hipox.c
+--- linux-2.6.24.orig/arch/arm/mach-hipox/hipox.c 2011-05-03 17:05:00.000000000 +0200
++++ linux-2.6.24/arch/arm/mach-hipox/hipox.c 2011-05-03 17:05:40.000000000 +0200
@@ -25,6 +25,7 @@
#include <linux/serial.h>
#include <linux/serial_core.h>
@@ -32,10 +20,22 @@ diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/hipox.c linux-2.6.24/arch/arm/
// To hold LED inversion state
int hipox_global_invert_leds = 0;
#include <linux/module.h>
-diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/smc.c linux-2.6.24/arch/arm/mach-hipox/smc.c
---- linux-2.6.24.orig//arch/arm/mach-hipox/smc.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.24/arch/arm/mach-hipox/smc.c 2010-01-29 11:51:26.000000000 +0100
-@@ -0,0 +1,73 @@
+diff -Nurd linux-2.6.24.orig/arch/arm/mach-hipox/Makefile linux-2.6.24/arch/arm/mach-hipox/Makefile
+--- linux-2.6.24.orig/arch/arm/mach-hipox/Makefile 2011-05-03 17:05:00.000000000 +0200
++++ linux-2.6.24/arch/arm/mach-hipox/Makefile 2011-05-03 17:05:40.000000000 +0200
+@@ -4,7 +4,7 @@
+
+ # Object file lists.
+
+-obj-y := hipox.o irq.o time.o dma.o pci.o ahb_mon.o leon.o samba_reserve.o
++obj-y := hipox.o irq.o time.o dma.o pci.o ahb_mon.o leon.o samba_reserve.o smc.o
+
+ obj-$(CONFIG_SYNOPSYS_GMAC) += gmac.o
+
+diff -Nurd linux-2.6.24.orig/arch/arm/mach-hipox/smc.c linux-2.6.24/arch/arm/mach-hipox/smc.c
+--- linux-2.6.24.orig/arch/arm/mach-hipox/smc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.24/arch/arm/mach-hipox/smc.c 2011-05-04 09:28:41.000000000 +0200
+@@ -0,0 +1,74 @@
+/*
+ * linux/arch/arm/mach-hipox/smc.c
+ *
@@ -62,8 +62,9 @@ diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/smc.c linux-2.6.24/arch/arm/ma
+#include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/module.h>
++#include <linux/hrtimer.h>
+
-+static unsigned int request_pci_timestamp = 0;
++static ktime_t request_pci_timestamp = {0};
+/*
+ * Request PCI_ARB to grant access to the STATIC core.
+ */
@@ -87,7 +88,7 @@ diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/smc.c linux-2.6.24/arch/arm/ma
+ if (!(readl(SYS_CTRL_PCI_STAT) & (1UL << SYSCTL_PCI_STAT_SYSPCI_STATIC_GNT)))
+ printk(KERN_WARNING "%s: timeout requesting access to PCI bus for static memory interface\n", __func__);
+
-+ request_pci_timestamp = jiffies_to_msecs(get_jiffies_64());
++ request_pci_timestamp = ktime_get();
+}
+
+/*
@@ -95,23 +96,23 @@ diff -Nurd linux-2.6.24.orig//arch/arm/mach-hipox/smc.c linux-2.6.24/arch/arm/ma
+ */
+void hipox_smc_release_pci_ad_31_0(void)
+{
-+ const unsigned int timeout = 100; /* ms */
-+ unsigned int delta = jiffies_to_msecs(get_jiffies_64()) - request_pci_timestamp;
++ const s64 timeout = 400; /* us */
++ s64 delta = ktime_us_delta(ktime_get(), request_pci_timestamp);
+
+ /* set PCI_ARB request bit in Sysctrl_PCI_Ctrl1 */
+ writel(readl(SYS_CTRL_PCI_CTRL1) & ~(1UL << SYSCTL_PCI_CTRL1_SYSPCI_STATIC_REQ), SYS_CTRL_PCI_CTRL1);
+
+ if (delta > timeout)
+ {
-+ printk(KERN_WARNING "%s: static memory interface blocked PCI bus for %u ms\n", __func__, delta);
++ printk(KERN_WARNING "%s: static memory interface blocked PCI bus for %llu us\n", __func__, delta);
+ }
+}
+
+EXPORT_SYMBOL(hipox_smc_request_pci_ad_31_0);
+EXPORT_SYMBOL(hipox_smc_release_pci_ad_31_0);
-diff -Nurd linux-2.6.24.orig//drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.24/drivers/mtd/chips/cfi_cmdset_0002.c
---- linux-2.6.24.orig//drivers/mtd/chips/cfi_cmdset_0002.c 2010-01-29 11:50:32.000000000 +0100
-+++ linux-2.6.24/drivers/mtd/chips/cfi_cmdset_0002.c 2010-01-29 11:51:26.000000000 +0100
+diff -Nurd linux-2.6.24.orig/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.24/drivers/mtd/chips/cfi_cmdset_0002.c
+--- linux-2.6.24.orig/drivers/mtd/chips/cfi_cmdset_0002.c 2011-05-03 17:04:58.000000000 +0200
++++ linux-2.6.24/drivers/mtd/chips/cfi_cmdset_0002.c 2011-05-03 17:05:40.000000000 +0200
@@ -46,11 +46,14 @@
#define MANUFACTURER_AMD 0x0001
@@ -152,9 +153,9 @@ diff -Nurd linux-2.6.24.orig//drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.24/d
#if !FORCE_WORD_WRITE
{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, },
#endif
-diff -Nurd linux-2.6.24.orig//drivers/mtd/maps/physmap.c linux-2.6.24/drivers/mtd/maps/physmap.c
---- linux-2.6.24.orig//drivers/mtd/maps/physmap.c 2010-01-29 11:50:32.000000000 +0100
-+++ linux-2.6.24/drivers/mtd/maps/physmap.c 2010-01-29 11:51:26.000000000 +0100
+diff -Nurd linux-2.6.24.orig/drivers/mtd/maps/physmap.c linux-2.6.24/drivers/mtd/maps/physmap.c
+--- linux-2.6.24.orig/drivers/mtd/maps/physmap.c 2011-05-03 17:04:58.000000000 +0200
++++ linux-2.6.24/drivers/mtd/maps/physmap.c 2011-05-03 17:05:40.000000000 +0200
@@ -18,11 +18,13 @@
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
@@ -258,9 +259,9 @@ diff -Nurd linux-2.6.24.orig//drivers/mtd/maps/physmap.c linux-2.6.24/drivers/mt
probe_type = rom_probe_types;
for (; info->mtd == NULL && *probe_type != NULL; probe_type++)
-diff -Nurd linux-2.6.24.orig//drivers/mtd/nand/hipox_nand.c linux-2.6.24/drivers/mtd/nand/hipox_nand.c
---- linux-2.6.24.orig//drivers/mtd/nand/hipox_nand.c 2010-01-29 11:50:32.000000000 +0100
-+++ linux-2.6.24/drivers/mtd/nand/hipox_nand.c 2010-01-29 11:51:26.000000000 +0100
+diff -Nurd linux-2.6.24.orig/drivers/mtd/nand/hipox_nand.c linux-2.6.24/drivers/mtd/nand/hipox_nand.c
+--- linux-2.6.24.orig/drivers/mtd/nand/hipox_nand.c 2011-05-03 17:04:58.000000000 +0200
++++ linux-2.6.24/drivers/mtd/nand/hipox_nand.c 2011-05-03 17:05:40.000000000 +0200
@@ -21,9 +21,10 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
@@ -455,9 +456,9 @@ diff -Nurd linux-2.6.24.orig//drivers/mtd/nand/hipox_nand.c linux-2.6.24/drivers
writel(0x20000000, GPIO_A_OUTPUT_CLEAR);
// reset NAND unit
-diff -Nurd linux-2.6.24.orig//include/asm-arm/arch-hipox/smc.h linux-2.6.24/include/asm-arm/arch-hipox/smc.h
---- linux-2.6.24.orig//include/asm-arm/arch-hipox/smc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.24/include/asm-arm/arch-hipox/smc.h 2010-01-29 11:51:26.000000000 +0100
+diff -Nurd linux-2.6.24.orig/include/asm-arm/arch-hipox/smc.h linux-2.6.24/include/asm-arm/arch-hipox/smc.h
+--- linux-2.6.24.orig/include/asm-arm/arch-hipox/smc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.24/include/asm-arm/arch-hipox/smc.h 2011-05-03 17:05:40.000000000 +0200
@@ -0,0 +1,28 @@
+/* linux/include/asm-arm/arch-hipox/smc.h
+ *
@@ -487,19 +488,20 @@ diff -Nurd linux-2.6.24.orig//include/asm-arm/arch-hipox/smc.h linux-2.6.24/incl
+void hipox_smc_release_pci_ad_31_0(void);
+
+#endif // __ASM_ARCH_SMC_H
-diff -Nurd linux-2.6.24.orig//include/asm-arm/arch-hipox/system.h linux-2.6.24/include/asm-arm/arch-hipox/system.h
---- linux-2.6.24.orig//include/asm-arm/arch-hipox/system.h 2010-01-29 11:50:34.000000000 +0100
-+++ linux-2.6.24/include/asm-arm/arch-hipox/system.h 2010-01-29 11:51:26.000000000 +0100
-@@ -8,5 +8,6 @@
+diff -Nurd linux-2.6.24.orig/include/asm-arm/arch-hipox/system.h linux-2.6.24/include/asm-arm/arch-hipox/system.h
+--- linux-2.6.24.orig/include/asm-arm/arch-hipox/system.h 2011-05-03 17:05:01.000000000 +0200
++++ linux-2.6.24/include/asm-arm/arch-hipox/system.h 2011-05-03 17:05:40.000000000 +0200
+@@ -8,6 +8,7 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
+#include <asm/proc-fns.h>
#include <asm/hardware.h>
#include <asm/io.h>
-diff -Nurd linux-2.6.24.orig//include/linux/mtd/cfi.h linux-2.6.24/include/linux/mtd/cfi.h
---- linux-2.6.24.orig//include/linux/mtd/cfi.h 2010-01-29 12:11:03.000000000 +0100
-+++ linux-2.6.24/include/linux/mtd/cfi.h 2010-01-29 12:11:24.000000000 +0100
+
+diff -Nurd linux-2.6.24.orig/include/linux/mtd/cfi.h linux-2.6.24/include/linux/mtd/cfi.h
+--- linux-2.6.24.orig/include/linux/mtd/cfi.h 2011-05-03 17:05:01.000000000 +0200
++++ linux-2.6.24/include/linux/mtd/cfi.h 2011-05-03 17:05:40.000000000 +0200
@@ -486,6 +486,7 @@
#define CFI_MFR_AMD 0x0001
diff --git a/recipes/linux/linux_2.6.24.bb b/recipes/linux/linux_2.6.24.bb
index 2552ae0277..97eef1b16e 100644
--- a/recipes/linux/linux_2.6.24.bb
+++ b/recipes/linux/linux_2.6.24.bb
@@ -107,6 +107,7 @@ SRC_URI_append_hipox = " \
file://siocoutqsnd.patch \
file://hipox-phy.patch \
file://ox810-pci-read-config-fix.patch \
+ file://hipox-nand-timing.patch \
"
EXTRA_OEMAKE_smartq5 = " OBJCOPY=${OBJCOPY}"