public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] Boot XIP kernel for IMX
@ 2008-02-28  7:24 Darius
  2008-03-03 13:22 ` Jörn Engel
  2008-04-22 18:51 ` David Woodhouse
  0 siblings, 2 replies; 3+ messages in thread
From: Darius @ 2008-02-28  7:24 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

Adds possibility to boot XIP kernel from flash for IMX.
I have tested it with M9328MXLADS V2.0 board.
It does NOT support write to flash, it only does support booting xip 
kernel. Somebody can continue and make feature to have rw rootfs in the 
flash with XIP kernel together:)

[-- Attachment #2: patch-imx-xip-support-2.6.24.3 --]
[-- Type: text/plain, Size: 2761 bytes --]

diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/arch/arm/Kconfig linux-2.6.24.3/arch/arm/Kconfig
--- linux-2.6.24.3-vanilla/arch/arm/Kconfig	2008-01-25 00:58:37.000000000 +0200
+++ linux-2.6.24.3/arch/arm/Kconfig	2008-02-27 14:51:50.000000000 +0200
@@ -244,6 +244,7 @@ config ARCH_IMX
 	select GENERIC_GPIO
 	select GENERIC_TIME
 	select GENERIC_CLOCKEVENTS
+	select ARCH_MTD_XIP
 	help
 	  Support for Motorola's i.MX family of processors (MX1, MXL).
diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/imx-regs.h linux-2.6.24.3/include/asm-arm/arch-imx/imx-regs.h
--- linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/imx-regs.h	2008-01-25 00:58:37.000000000 +0200
+++ linux-2.6.24.3/include/asm-arm/arch-imx/imx-regs.h	2008-02-13 17:58:42.000000000 +0200
@@ -348,6 +348,10 @@
 #define IMX_INTENABLEH     __REG(IMX_AITC_BASE+0x10)
 #define IMX_INTENABLEL     __REG(IMX_AITC_BASE+0x14)
 
+#define IMX_NIPNDH	__REG(IMX_AITC_BASE+0x58) 		/* Normal Interrupt Pending Register High */
+#define IMX_NIPNDL 	__REG(IMX_AITC_BASE+0x5C)		/* Normal Interrupt Pending Register Low  */
+
+
 /*
  *  General purpose timers
  */
diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/mtd-xip.h linux-2.6.24.3/include/asm-arm/arch-imx/mtd-xip.h
--- linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/mtd-xip.h	1970-01-01 03:00:00.000000000 +0300
+++ linux-2.6.24.3/include/asm-arm/arch-imx/mtd-xip.h	2008-02-27 15:00:22.000000000 +0200
@@ -0,0 +1,37 @@
+/*
+ * MTD primitives for XIP support. Architecture specific functions
+ *
+ * Do not include this file directly. It's included from linux/mtd/xip.h
+ * 
+ * Author:	
+ * Created:	Nov 2, 2004
+ * Copyright:	(C) 2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
+ */
+
+#ifndef __ARCH_IMX_MTD_XIP_H__
+#define __ARCH_IMX_MTD_XIP_H__
+
+#include <asm/arch/imx-regs.h>
+
+#define xip_irqpending()        (( IMX_INTENABLEH  & IMX_NIPNDH ) || ( IMX_INTENABLEL & IMX_NIPNDL ))
+#define xip_currtime()          (IMX_TCN(1))
+#define xip_elapsed_since(x)    (signed)((IMX_TCN(1) - (x)) / 4)
+
+/*
+#define xip_irqpending()        ( IMX_NIPNDH || IMX_NIPNDL )
+#define xip_currtime()          (IMX_TCN(IMX_TIM1_BASE))
+#define xip_elapsed_since(x)    (signed)((IMX_TCN(IMX_TIM1_BASE) -(x)) * 31)
+*/
+
+//#define xip_cpu_idle()  asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))
+
+#warning IMX_MTD_XIP enabled!
+
+#endif /* __ARCH_IMX_MTD_XIP_H__ */
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Boot XIP kernel for IMX
  2008-02-28  7:24 [PATCH] Boot XIP kernel for IMX Darius
@ 2008-03-03 13:22 ` Jörn Engel
  2008-04-22 18:51 ` David Woodhouse
  1 sibling, 0 replies; 3+ messages in thread
From: Jörn Engel @ 2008-03-03 13:22 UTC (permalink / raw)
  To: Darius; +Cc: linux-mtd

On Thu, 28 February 2008 09:24:26 +0200, Darius wrote:
> +
> +/*
> +#define xip_irqpending()        ( IMX_NIPNDH || IMX_NIPNDL )
> +#define xip_currtime()          (IMX_TCN(IMX_TIM1_BASE))
> +#define xip_elapsed_since(x)    (signed)((IMX_TCN(IMX_TIM1_BASE) -(x)) * 31)
> +*/
> +
> +//#define xip_cpu_idle()  asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))

Is there a reason to leave these bits in the patch?

Jörn

-- 
When people work hard for you for a pat on the back, you've got
to give them that pat.
-- Robert Heinlein

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Boot XIP kernel for IMX
  2008-02-28  7:24 [PATCH] Boot XIP kernel for IMX Darius
  2008-03-03 13:22 ` Jörn Engel
@ 2008-04-22 18:51 ` David Woodhouse
  1 sibling, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2008-04-22 18:51 UTC (permalink / raw)
  To: Darius; +Cc: rmk+linux, linux-mtd

On Thu, 2008-02-28 at 09:24 +0200, Darius wrote:
> Adds possibility to boot XIP kernel from flash for IMX.
> I have tested it with M9328MXLADS V2.0 board.
> It does NOT support write to flash, it only does support booting xip 
> kernel. Somebody can continue and make feature to have rw rootfs in
> the 
> flash with XIP kernel together:)

Why doesn't write support work? If probes work, shouldn't writes?

This is an ARM architecture change and should probably go via rmk.

> diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/arch/arm/Kconfig linux-2.6.24.3/arch/arm/Kconfig
> --- linux-2.6.24.3-vanilla/arch/arm/Kconfig	2008-01-25 00:58:37.000000000 +0200
> +++ linux-2.6.24.3/arch/arm/Kconfig	2008-02-27 14:51:50.000000000 +0200
> @@ -244,6 +244,7 @@ config ARCH_IMX
>  	select GENERIC_GPIO
>  	select GENERIC_TIME
>  	select GENERIC_CLOCKEVENTS
> +	select ARCH_MTD_XIP
>  	help
>  	  Support for Motorola's i.MX family of processors (MX1, MXL).
> diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/imx-regs.h linux-2.6.24.3/include/asm-arm/arch-imx/imx-regs.h
> --- linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/imx-regs.h	2008-01-25 00:58:37.000000000 +0200
> +++ linux-2.6.24.3/include/asm-arm/arch-imx/imx-regs.h	2008-02-13 17:58:42.000000000 +0200
> @@ -348,6 +348,10 @@
>  #define IMX_INTENABLEH     __REG(IMX_AITC_BASE+0x10)
>  #define IMX_INTENABLEL     __REG(IMX_AITC_BASE+0x14)
>  
> +#define IMX_NIPNDH	__REG(IMX_AITC_BASE+0x58) 		/* Normal Interrupt Pending Register High */
> +#define IMX_NIPNDL 	__REG(IMX_AITC_BASE+0x5C)		/* Normal Interrupt Pending Register Low  */
> +
> +
>  /*
>   *  General purpose timers
>   */
> diff -uprN -X linux-2.6.24.3-vanilla//Documentation/dontdiff linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/mtd-xip.h linux-2.6.24.3/include/asm-arm/arch-imx/mtd-xip.h
> --- linux-2.6.24.3-vanilla/include/asm-arm/arch-imx/mtd-xip.h	1970-01-01 03:00:00.000000000 +0300
> +++ linux-2.6.24.3/include/asm-arm/arch-imx/mtd-xip.h	2008-02-27 15:00:22.000000000 +0200
> @@ -0,0 +1,37 @@
> +/*
> + * MTD primitives for XIP support. Architecture specific functions
> + *
> + * Do not include this file directly. It's included from linux/mtd/xip.h
> + * 
> + * Author:	
> + * Created:	Nov 2, 2004
> + * Copyright:	(C) 2004 MontaVista Software, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
> + */
> +
> +#ifndef __ARCH_IMX_MTD_XIP_H__
> +#define __ARCH_IMX_MTD_XIP_H__
> +
> +#include <asm/arch/imx-regs.h>
> +
> +#define xip_irqpending()        (( IMX_INTENABLEH  & IMX_NIPNDH ) || ( IMX_INTENABLEL & IMX_NIPNDL ))
> +#define xip_currtime()          (IMX_TCN(1))
> +#define xip_elapsed_since(x)    (signed)((IMX_TCN(1) - (x)) / 4)
> +
> +/*
> +#define xip_irqpending()        ( IMX_NIPNDH || IMX_NIPNDL )
> +#define xip_currtime()          (IMX_TCN(IMX_TIM1_BASE))
> +#define xip_elapsed_since(x)    (signed)((IMX_TCN(IMX_TIM1_BASE) -(x)) * 31)
> +*/
> +
> +//#define xip_cpu_idle()  asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))
> +
> +#warning IMX_MTD_XIP enabled!
> +
> +#endif /* __ARCH_IMX_MTD_XIP_H__ */
> +
-- 
dwmw2

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-22 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28  7:24 [PATCH] Boot XIP kernel for IMX Darius
2008-03-03 13:22 ` Jörn Engel
2008-04-22 18:51 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox