public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Darius <augulis.darius@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] Boot XIP kernel for IMX
Date: Thu, 28 Feb 2008 09:24:26 +0200	[thread overview]
Message-ID: <fq5nlh$h6g$2@ger.gmane.org> (raw)

[-- 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__ */
+

             reply	other threads:[~2008-02-28  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  7:24 Darius [this message]
2008-03-03 13:22 ` [PATCH] Boot XIP kernel for IMX Jörn Engel
2008-04-22 18:51 ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='fq5nlh$h6g$2@ger.gmane.org' \
    --to=augulis.darius@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox