Skip to contentSkip to conversation

common arm clkdev

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 9 messages Aug 4, 2010

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

cover common arm clkdev

Hi,

this patch series add the arm common clkdev support with the support of the STm8815 soc which use is for the generic ARM amba serial API

Jean-Christophe PLAGNIOL-VILLARD (6):
string: add strlcpy support
arm: add common clkdev
amba: add pl011
arm: add Nomadik 8815 SoC support
nand: driver for Nomadik 8815 SoC
arm: add nhk8815 board support

 arch/arm/Kconfig                                   |   11 +
 arch/arm/Makefile                                  |    4 +-
 arch/arm/boards/nhk8815/Makefile                   |    1 +
 arch/arm/boards/nhk8815/env/bin/_update            |   36 +++
 arch/arm/boards/nhk8815/env/bin/boot               |   38 +++
 arch/arm/boards/nhk8815/env/bin/init               |   28 +++
 .../boards/nhk8815/env/bin/update_barebox_xmodem   |   19 ++
 arch/arm/boards/nhk8815/env/bin/update_kernel      |    8 +
 arch/arm/boards/nhk8815/env/bin/update_root        |    8 +
 arch/arm/boards/nhk8815/env/config                 |   32 +++
 arch/arm/boards/nhk8815/setup.c                    |  106 +++++++++
 arch/arm/common/Kconfig                            |    2 +
 arch/arm/common/Makefile                           |    5 +
 arch/arm/common/clkdev.c                           |  160 +++++++++++++
 arch/arm/configs/nhk8815_defconfig                 |  232 ++++++++++++++++++
 arch/arm/include/asm/clkdev.h                      |   30 +++
 arch/arm/mach-nomadik/8815.c                       |   76 ++++++
 arch/arm/mach-nomadik/Kconfig                      |   24 ++
 arch/arm/mach-nomadik/Makefile                     |    3 +
 arch/arm/mach-nomadik/clock.c                      |   52 ++++
 arch/arm/mach-nomadik/clock.h                      |   14 ++
 arch/arm/mach-nomadik/include/mach/board.h         |   28 +++
 arch/arm/mach-nomadik/include/mach/clkdev.h        |    7 +
 arch/arm/mach-nomadik/include/mach/fsmc.h          |   28 +++
 arch/arm/mach-nomadik/include/mach/hardware.h      |   91 +++++++
 arch/arm/mach-nomadik/include/mach/mtu.h           |   46 ++++
 arch/arm/mach-nomadik/include/mach/nand.h          |   16 ++
 arch/arm/mach-nomadik/include/mach/timex.h         |    6 +
 arch/arm/mach-nomadik/reset.c                      |   36 +++
 arch/arm/mach-nomadik/timer.c                      |   81 +++++++
 drivers/mtd/nand/Kconfig                           |    5 +
 drivers/mtd/nand/Makefile                          |    1 +
 drivers/mtd/nand/nomadik_nand.c                    |  248 ++++++++++++++++++++
 drivers/serial/Kconfig                             |    9 +
 drivers/serial/Makefile                            |    1 +
 drivers/serial/amba-pl011.c                        |  192 +++++++++++++++
 include/linux/amba/serial.h                        |  164 +++++++++++++
 include/linux/string.h                             |    3 +
 include/stdio.h                                    |    1 +
 lib/string.c                                       |   26 ++
 lib/vsprintf.c                                     |   25 ++
 41 files changed, 1902 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/boards/nhk8815/Makefile
 create mode 100644 arch/arm/boards/nhk8815/config.h
 create mode 100644 arch/arm/boards/nhk8815/env/bin/_update
 create mode 100644 arch/arm/boards/nhk8815/env/bin/boot
 create mode 100644 arch/arm/boards/nhk8815/env/bin/init
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_kernel
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_root
 create mode 100644 arch/arm/boards/nhk8815/env/config
 create mode 100644 arch/arm/boards/nhk8815/setup.c
 create mode 100644 arch/arm/common/Kconfig
 create mode 100644 arch/arm/common/Makefile
 create mode 100644 arch/arm/common/clkdev.c
 create mode 100644 arch/arm/configs/nhk8815_defconfig
 create mode 100644 arch/arm/include/asm/clkdev.h
 create mode 100644 arch/arm/mach-nomadik/8815.c
 create mode 100644 arch/arm/mach-nomadik/Kconfig
 create mode 100644 arch/arm/mach-nomadik/Makefile
 create mode 100644 arch/arm/mach-nomadik/clock.c
 create mode 100644 arch/arm/mach-nomadik/clock.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/board.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/fsmc.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/hardware.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/mtu.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/nand.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/timex.h
 create mode 100644 arch/arm/mach-nomadik/reset.c
 create mode 100644 arch/arm/mach-nomadik/timer.c
 create mode 100644 drivers/mtd/nand/nomadik_nand.c
 create mode 100644 drivers/serial/amba-pl011.c
 create mode 100644 include/linux/amba/serial.h

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH 1/6 string: add strlcpy support

---
 include/linux/string.h |    3 +++
 include/stdio.h        |    1 +
 lib/string.c           |   26 ++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 0 deletions(-)
include/linux/string.h +3 -0
index 20b0829..62d743e 100644
@@ -38,6 +38,9 @@ extern char * strcpy(char *,const char *);
 #ifndef __HAVE_ARCH_STRNCPY
 extern char * strncpy(char *,const char *, __kernel_size_t);
 #endif
+#ifndef __HAVE_ARCH_STRLCPY
+size_t strlcpy(char *, const char *, size_t);
+#endif
 #ifndef __HAVE_ARCH_STRCAT
 extern char * strcat(char *, const char *);
 #endif
include/stdio.h +1 -0
index d591b6a..8bc45fa 100644
@@ -36,6 +36,7 @@ int	vsprintf(char *buf, const char *fmt, va_list args);
 char	*asprintf(const char *fmt, ...);
 char	*vasprintf(const char *fmt, va_list ap);
 int	vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+int	vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
 
 /* stderr */
 #define eputc(c)		console_putc(CONSOLE_STDERR, c)
lib/string.c +26 -0
index cbb13d3..77435aa 100644
@@ -62,6 +62,32 @@ char * strncpy(char * dest,const char *src,size_t count)
 #endif
 EXPORT_SYMBOL(strncpy);
 
+#ifndef __HAVE_ARCH_STRLCPY
+/**
+ * strlcpy - Copy a %NUL terminated string into a sized buffer
+ * @dest: Where to copy the string to
+ * @src: Where to copy the string from
+ * @size: size of destination buffer
+ *
+ * Compatible with *BSD: the result is always a valid
+ * NUL-terminated string that fits in the buffer (unless,
+ * of course, the buffer size is zero). It does not pad
+ * out the result like strncpy() does.
+ */
+size_t strlcpy(char *dest, const char *src, size_t size)
+{
+	size_t ret = strlen(src);
+
+	if (size) {
+		size_t len = (ret >= size) ? size - 1 : ret;
+		memcpy(dest, src, len);
+		dest[len] = '\0';
+	}
+	return ret;
+}
+EXPORT_SYMBOL(strlcpy);
+#endif
+
 #ifndef __HAVE_ARCH_STRCAT
 /**
  * strcat - Append one %NUL-terminated string to another
Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/6 arm: add common clkdev

---
 arch/arm/Kconfig              |    1 +
 arch/arm/Makefile             |    2 +-
 arch/arm/common/Kconfig       |    2 +
 arch/arm/common/Makefile      |    5 ++
 arch/arm/common/clkdev.c      |  160 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/include/asm/clkdev.h |   30 ++++++++
 lib/vsprintf.c                |   25 +++++++
 7 files changed, 224 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/common/Kconfig
 create mode 100644 arch/arm/common/Makefile
 create mode 100644 arch/arm/common/clkdev.c
 create mode 100644 arch/arm/include/asm/clkdev.h
arch/arm/Kconfig +1 -0
index 92ec417..ed05a89 100644
@@ -53,6 +53,7 @@ config ARCH_S3C24xx
 
 endchoice
 
+source arch/arm/common/Kconfig
 source arch/arm/cpu/Kconfig
 source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-at91rm9200/Kconfig
arch/arm/Makefile +1 -1
index 8b4d64c..bd78259 100644
@@ -130,7 +130,7 @@ MACH :=
 endif
 
 common-y += $(BOARD) $(MACH)
-common-y += arch/arm/lib/ arch/arm/cpu/
+common-y += arch/arm/lib/ arch/arm/cpu/ arch/arm/common/
 
 lds-$(CONFIG_GENERIC_LINKER_SCRIPT)	:= arch/arm/lib/barebox.lds
 lds-$(CONFIG_BOARD_LINKER_SCRIPT)	:= $(BOARD)/barebox.lds
arch/arm/common/Kconfig new file +2 -0
new file mode 100644
index 0000000..e749e45
@@ -0,0 +1,2 @@
+config COMMON_CLKDEV
+	bool
arch/arm/common/Makefile new file +5 -0
new file mode 100644
index 0000000..9cc8834
@@ -0,0 +1,5 @@
+#
+# Makefile for the linux kernel.
+#
+
+obj-$(CONFIG_COMMON_CLKDEV)	+= clkdev.o
arch/arm/common/clkdev.c new file +160 -0

160 lines not on this page · raw message

arch/arm/include/asm/clkdev.h new file +30 -0
new file mode 100644
index 0000000..b6ec7c6
@@ -0,0 +1,30 @@
+/*
+ *  arch/arm/include/asm/clkdev.h
+ *
+ *  Copyright (C) 2008 Russell King.
+ *
+ * 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.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+struct clk;
+
+struct clk_lookup {
+	struct list_head	node;
+	const char		*dev_id;
+	const char		*con_id;
+	struct clk		*clk;
+};
+
+struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
+	const char *dev_fmt, ...);
+
+void clkdev_add(struct clk_lookup *cl);
+void clkdev_drop(struct clk_lookup *cl);
+
+#endif
lib/vsprintf.c +25 -0
index 91ad613..6066845 100644
@@ -515,6 +515,31 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 EXPORT_SYMBOL(vsnprintf);
 
 /**
+ * vscnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @args: Arguments for the format string
+ *
+ * The return value is the number of characters which have been written into
+ * the @buf not including the trailing '\0'. If @size is <= 0 the function
+ * returns 0.
+ *
+ * Call this function if you are already dealing with a va_list.
+ * You probably want scnprintf() instead.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
+ */
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
+{
+	int i;
+
+	i=vsnprintf(buf,size,fmt,args);
+	return (i >= size) ? (size - 1) : i;
+}
+EXPORT_SYMBOL(vscnprintf);
+
+/**
  * vsprintf - Format a string and place it in a buffer
  * @buf: The buffer to place the result into
  * @fmt: The format string to use
Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/6 amba: add pl011

---
 arch/arm/Kconfig            |    3 +
 drivers/serial/Kconfig      |    9 ++
 drivers/serial/Makefile     |    1 +
 drivers/serial/amba-pl011.c |  192 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/amba/serial.h |  164 ++++++++++++++++++++++++++++++++++++
 5 files changed, 369 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/amba-pl011.c
 create mode 100644 include/linux/amba/serial.h
arch/arm/Kconfig +3 -0
index ed05a89..53b7783 100644
@@ -18,6 +18,9 @@ config ARM
 	select HAVE_CONFIGURABLE_TEXT_BASE
 	default y
 
+config ARM_AMBA
+	bool
+
 menu "System Type"
 
 choice
drivers/serial/Kconfig +9 -0
index 8a5056b..c7ea2d9 100644
@@ -4,6 +4,15 @@ config DRIVER_SERIAL_ARM_DCC
 	depends on ARM
 	bool "ARM Debug Communications Channel (DCC) serial driver"
 
+config SERIAL_AMBA_PL011
+	bool "ARM AMBA PL011 serial port support"
+	depends on ARM_AMBA
+	help
+	  This selects the ARM(R) AMBA(R) PrimeCell PL011 UART.  If you have
+	  an Integrator/PP2, Integrator/CP or Versatile platform, say Y here.
+
+	  If unsure, say N.
+
 config DRIVER_SERIAL_IMX
 	depends on ARCH_IMX
 	default y
drivers/serial/Makefile +1 -0
index 9f203bb..959290e 100644
@@ -5,6 +5,7 @@
 # serial_pl010.o
 # serial_xuartlite.o
 obj-$(CONFIG_DRIVER_SERIAL_ARM_DCC)		+= arm_dcc.o
+obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
 obj-$(CONFIG_DRIVER_SERIAL_IMX)			+= serial_imx.o
 obj-$(CONFIG_DRIVER_SERIAL_ATMEL)		+= atmel.o
 obj-$(CONFIG_DRIVER_SERIAL_NETX)		+= serial_netx.o
drivers/serial/amba-pl011.c new file +192 -0

192 lines not on this page · raw message

include/linux/amba/serial.h new file +164 -0

164 lines not on this page · raw message

Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/6 arm: add Nomadik 8815 SoC support

---
 arch/arm/Kconfig                              |    7 ++
 arch/arm/Makefile                             |    1 +
 arch/arm/mach-nomadik/8815.c                  |   76 +++++++++++++++++++++
 arch/arm/mach-nomadik/Kconfig                 |   11 +++
 arch/arm/mach-nomadik/Makefile                |    3 +
 arch/arm/mach-nomadik/clock.c                 |   52 ++++++++++++++
 arch/arm/mach-nomadik/clock.h                 |   14 ++++
 arch/arm/mach-nomadik/include/mach/board.h    |   28 ++++++++
 arch/arm/mach-nomadik/include/mach/clkdev.h   |    7 ++
 arch/arm/mach-nomadik/include/mach/fsmc.h     |   28 ++++++++
 arch/arm/mach-nomadik/include/mach/hardware.h |   91 +++++++++++++++++++++++++
 arch/arm/mach-nomadik/include/mach/mtu.h      |   46 +++++++++++++
 arch/arm/mach-nomadik/include/mach/timex.h    |    6 ++
 arch/arm/mach-nomadik/reset.c                 |   36 ++++++++++
 arch/arm/mach-nomadik/timer.c                 |   81 ++++++++++++++++++++++
 15 files changed, 487 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-nomadik/8815.c
 create mode 100644 arch/arm/mach-nomadik/Kconfig
 create mode 100644 arch/arm/mach-nomadik/Makefile
 create mode 100644 arch/arm/mach-nomadik/clock.c
 create mode 100644 arch/arm/mach-nomadik/clock.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/board.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/fsmc.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/hardware.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/mtu.h
 create mode 100644 arch/arm/mach-nomadik/include/mach/timex.h
 create mode 100644 arch/arm/mach-nomadik/reset.c
 create mode 100644 arch/arm/mach-nomadik/timer.c
arch/arm/Kconfig +7 -0
index 53b7783..82dbfda 100644
@@ -47,6 +47,12 @@ config ARCH_NETX
 	bool "Hilscher NetX based"
 	select CPU_ARM926T
 
+config ARCH_NOMADIK
+	bool "STMicroelectronics Nomadik"
+	select CPU_ARM926T
+	help
+	 Support for the Nomadik platform by ST-Ericsson
+
 config ARCH_OMAP
 	bool "TI OMAP"
 
@@ -63,6 +69,7 @@ source arch/arm/mach-at91rm9200/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
 source arch/arm/mach-imx/Kconfig
 source arch/arm/mach-netx/Kconfig
+source arch/arm/mach-nomadik/Kconfig
 source arch/arm/mach-omap/Kconfig
 source arch/arm/mach-s3c24xx/Kconfig
 
arch/arm/Makefile +1 -0
index bd78259..4d6a76d 100644
@@ -42,6 +42,7 @@ machine-$(CONFIG_ARCH_AT91)		:= at91
 machine-$(CONFIG_ARCH_AT91RM9200)	:= at91rm9200
 machine-$(CONFIG_ARCH_EP93XX)		:= ep93xx
 machine-$(CONFIG_ARCH_IMX)		:= imx
+machine-$(CONFIG_ARCH_NOMADIK)		:= nomadik
 machine-$(CONFIG_ARCH_NETX)		:= netx
 machine-$(CONFIG_ARCH_OMAP)		:= omap
 machine-$(CONFIG_ARCH_S3C24xx)		:= s3c24xx
arch/arm/mach-nomadik/8815.c new file +76 -0

76 lines not on this page · raw message

arch/arm/mach-nomadik/Kconfig new file +11 -0
new file mode 100644
index 0000000..4cf3f7b
@@ -0,0 +1,11 @@
+if ARCH_NOMADIK
+
+choice
+	prompt "Nomadik boards"
+
+endchoice
+
+config NOMADIK_8815
+	bool
+
+endif
arch/arm/mach-nomadik/Makefile new file +3 -0
new file mode 100644
index 0000000..1d77c4c
@@ -0,0 +1,3 @@
+
+obj-y	+= clock.o reset.o timer.o
+obj-y	+= 8815.o
arch/arm/mach-nomadik/clock.c new file +52 -0

52 lines not on this page · raw message

arch/arm/mach-nomadik/clock.h new file +14 -0
new file mode 100644
index 0000000..eade4a6
@@ -0,0 +1,14 @@
+/*
+ * linux/arch/arm/mach-nomadik/clock.h
+ *
+ * Copyright (C) 2009 Alessandro Rubini
+ *
+ * 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.
+ */
+struct clk {
+	unsigned long	rate;
+};
+
+int nmdk_clk_create(struct clk *clk, const char *dev_id);
arch/arm/mach-nomadik/include/mach/board.h new file +28 -0
new file mode 100644
index 0000000..b4979fe
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASM_ARCH_BOARD_H
+#define __ASM_ARCH_BOARD_H
+
+void st8815_add_device_sdram(u32 size);
+
+void st8815_register_uart(unsigned id);
+
+#endif
arch/arm/mach-nomadik/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..04b37a8
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/mach-nomadik/include/mach/fsmc.h new file +28 -0
new file mode 100644
index 0000000..e010c72
@@ -0,0 +1,28 @@
+/* Definitions for the Nomadik FSMC "Flexible Static Memory controller" */
+
+#ifndef __ASM_ARCH_FSMC_H
+#define __ASM_ARCH_FSMC_H
+
+#include <mach/hardware.h>
+/*
+ * Register list
+ */
+
+/* bus control reg. and bus timing reg. for CS0..CS3 */
+#define FSMC_BCR(x)     (NOMADIK_FSMC_VA + (x << 3))
+#define FSMC_BTR(x)     (NOMADIK_FSMC_VA + (x << 3) + 0x04)
+
+/* PC-card and NAND:
+ * PCR = control register
+ * PMEM = memory timing
+ * PATT = attribute timing
+ * PIO = I/O timing
+ * PECCR = ECC result
+ */
+#define FSMC_PCR(x)     (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x00)
+#define FSMC_PMEM(x)    (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x08)
+#define FSMC_PATT(x)    (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x0c)
+#define FSMC_PIO(x)     (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x10)
+#define FSMC_PECCR(x)   (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x14)
+
+#endif /* __ASM_ARCH_FSMC_H */
arch/arm/mach-nomadik/include/mach/hardware.h new file +91 -0

91 lines not on this page · raw message

arch/arm/mach-nomadik/include/mach/mtu.h new file +46 -0

46 lines not on this page · raw message

arch/arm/mach-nomadik/include/mach/timex.h new file +6 -0
new file mode 100644
index 0000000..b2b41fa
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARCH_TIMEX_H
+#define __ASM_ARCH_TIMEX_H
+
+#define CLOCK_TICK_RATE	2400000
+
+#endif
arch/arm/mach-nomadik/reset.c new file +36 -0
new file mode 100644
index 0000000..d55f278
@@ -0,0 +1,36 @@
+/*
+ *  mach-nomadik/include/mach/system.h
+ *
+ *  Copyright (C) 2008 STMicroelectronics
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <mach/hardware.h>
+
+void __noreturn reset_cpu(unsigned long addr)
+{
+	void __iomem *src_rstsr = (void *)(NOMADIK_SRC_BASE + 0x18);
+
+	/* FIXME: use egpio when implemented */
+
+	/* Write anything to Reset status register */
+	writel(1, src_rstsr);
+
+	/* Not reached */
+	while (1);
+}
+EXPORT_SYMBOL(reset_cpu);
arch/arm/mach-nomadik/timer.c new file +81 -0

81 lines not on this page · raw message

Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/6 nand: driver for Nomadik 8815 SoC

---
 arch/arm/mach-nomadik/include/mach/nand.h |   16 ++
 drivers/mtd/nand/Kconfig                  |    5 +
 drivers/mtd/nand/Makefile                 |    1 +
 drivers/mtd/nand/nomadik_nand.c           |  248 +++++++++++++++++++++++++++++
 4 files changed, 270 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-nomadik/include/mach/nand.h
 create mode 100644 drivers/mtd/nand/nomadik_nand.c
arch/arm/mach-nomadik/include/mach/nand.h new file +16 -0
new file mode 100644
index 0000000..265fe53
@@ -0,0 +1,16 @@
+#ifndef __ASM_ARCH_NAND_H
+#define __ASM_ARCH_NAND_H
+
+struct nomadik_nand_platform_data {
+	unsigned long data_va;
+	unsigned long cmd_va;
+	unsigned long addr_va;
+	int options;
+	int (*init) (void);
+};
+
+#define NAND_IO_DATA	0x40000000
+#define NAND_IO_CMD	0x40800000
+#define NAND_IO_ADDR	0x41000000
+
+#endif				/* __ASM_ARCH_NAND_H */
drivers/mtd/nand/Kconfig +5 -0
index ddc0c34..475499a 100644
@@ -97,5 +97,10 @@ config MTD_NAND_DISKONCHIP_BBTWRITE
 	  load time (assuming you build diskonchip as a module) with the module
 	  parameter "inftl_bbt_write=1".
 
+config MTD_NAND_NOMADIK
+	tristate "ST Nomadik 8815 NAND support"
+	depends on ARCH_NOMADIK
+	help
+	  Driver for the NAND flash controller on the Nomadik, with ECC.
 
 endif
drivers/mtd/nand/Makefile +1 -0
index 73f7346..bac39e7 100644
@@ -5,6 +5,7 @@ obj-$(CONFIG_MTD_NAND_IDS)		+= nand_ids.o
 obj-$(CONFIG_NAND)			+= nand_base.o nand_bbt.o
 
 obj-$(CONFIG_MTD_NAND_DISKONCHIP)	+= diskonchip.o
+obj-$(CONFIG_MTD_NAND_NOMADIK)		+= nomadik_nand.o
 obj-$(CONFIG_NAND_IMX)			+= nand_imx.o
 obj-$(CONFIG_NAND_OMAP_GPMC)		+= nand_omap_gpmc.o
 obj-$(CONFIG_NAND_ATMEL)		+= atmel_nand.o
drivers/mtd/nand/nomadik_nand.c new file +248 -0

248 lines not on this page · raw message

Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 6/6 arm: add nhk8815 board support

with the following support

uart 0 & 1
network
nand

---
 arch/arm/Makefile                                  |    1 +
 arch/arm/boards/nhk8815/Makefile                   |    1 +
 arch/arm/boards/nhk8815/env/bin/_update            |   36 +++
 arch/arm/boards/nhk8815/env/bin/boot               |   38 ++++
 arch/arm/boards/nhk8815/env/bin/init               |   28 +++
 .../boards/nhk8815/env/bin/update_barebox_xmodem   |   19 ++
 arch/arm/boards/nhk8815/env/bin/update_kernel      |    8 +
 arch/arm/boards/nhk8815/env/bin/update_root        |    8 +
 arch/arm/boards/nhk8815/env/config                 |   32 +++
 arch/arm/boards/nhk8815/setup.c                    |  106 +++++++++
 arch/arm/configs/nhk8815_defconfig                 |  232 ++++++++++++++++++++
 arch/arm/mach-nomadik/Kconfig                      |   13 +
 12 files changed, 522 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/nhk8815/Makefile
 create mode 100644 arch/arm/boards/nhk8815/config.h
 create mode 100644 arch/arm/boards/nhk8815/env/bin/_update
 create mode 100644 arch/arm/boards/nhk8815/env/bin/boot
 create mode 100644 arch/arm/boards/nhk8815/env/bin/init
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_kernel
 create mode 100644 arch/arm/boards/nhk8815/env/bin/update_root
 create mode 100644 arch/arm/boards/nhk8815/env/config
 create mode 100644 arch/arm/boards/nhk8815/setup.c
 create mode 100644 arch/arm/configs/nhk8815_defconfig
arch/arm/Makefile +1 -0
index 4d6a76d..4827fe9 100644
@@ -70,6 +70,7 @@ board-$(CONFIG_MACH_IMX21ADS)			:= imx21ads
 board-$(CONFIG_MACH_IMX27ADS)			:= imx27ads
 board-$(CONFIG_MACH_MMCCPU)			:= mmccpu
 board-$(CONFIG_MACH_MX1ADS)			:= mx1ads
+board-$(CONFIG_MACH_NOMADIK_8815NHK)		:= nhk8815
 board-$(CONFIG_MACH_NXDB500)			:= netx
 board-$(CONFIG_ARCH_OMAP)			:= omap
 board-$(CONFIG_MACH_PCA100)			:= phycard-i.MX27
arch/arm/boards/nhk8815/Makefile new file +1 -0
new file mode 100644
index 0000000..2b9dba4
@@ -0,0 +1 @@
+obj-y += setup.o
arch/arm/boards/nhk8815/config.h new file +0 -0
new file mode 100644
index 0000000..e69de29
arch/arm/boards/nhk8815/env/bin/_update new file +36 -0
new file mode 100644
index 0000000..fb7cbe8
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+if [ -z "$part" -o -z "$image" ]; then
+	echo "define \$part and \$image"
+	exit 1
+fi
+
+if [ \! -e "$part" ]; then
+	echo "Partition $part does not exist"
+	exit 1
+fi
+
+if [ $# = 1 ]; then
+	image=$1
+fi
+
+if [ x$ip = xdhcp ]; then
+	dhcp
+fi
+
+ping $eth0.serverip
+if [ $? -ne 0 ] ; then
+	echo "update aborted"
+	exit 1
+fi
+
+unprotect $part
+
+echo
+echo "erasing partition $part"
+erase $part
+
+echo
+echo "flashing $image to $part"
+echo
+tftp $image $part
arch/arm/boards/nhk8815/env/bin/boot new file +38 -0
new file mode 100644
index 0000000..fd8d957
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. /env/config
+
+if [ x$1 = xflash ]; then
+	root=flash
+	kernel=flash
+fi
+
+if [ x$1 = xnet ]; then
+	root=net
+	kernel=net
+fi
+
+if [ x$ip = xdhcp ]; then
+	bootargs="$bootargs ip=dhcp"
+else
+	bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
+fi
+
+if [ x$root = xflash ]; then
+	bootargs="$bootargs root=$rootpart rootfstype=jffs2"
+else
+	bootargs="$bootargs root=/dev/nfs nfsroot=192.168.23.111:$nfsroot"
+fi
+
+bootargs="$bootargs"
+
+if [ $kernel = net ]; then
+	if [ x$ip = xdhcp ]; then
+		dhcp
+	fi
+	tftp $uimage uImage
+	bootm uImage
+else
+	bootm /dev/nor0.kernel
+fi
+
arch/arm/boards/nhk8815/env/bin/init new file +28 -0
new file mode 100644
index 0000000..5b45a70
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+PATH=/env/bin
+export PATH
+
+. /env/config
+
+if [ -e /dev/nand0 ]; then
+	addpart /dev/nand0 $nand_parts
+
+	# Uh, oh, hush first expands wildcards and then starts executing
+	# commands. What a bug!
+	source /env/bin/hush_hack
+fi
+
+echo
+echo -n "Hit any key to stop autoboot: "
+timeout -a $autoboot_timeout
+if [ $? != 0 ]; then
+	echo
+	echo "type update_kernel [<imagename>] to update kernel into flash"
+	echo "type udate_root [<imagename>] to update rootfs into flash"
+	echo "type update_barebox_xmodem nor to update barebox into flash"
+	echo
+	exit
+fi
+
+boot
arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem new file +19 -0
new file mode 100644
index 0000000..40f4ad3
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /env/config
+
+part=/dev/nand0.barebox
+
+loadb -f barebox.bin -c
+
+unprotect $part
+echo
+echo "erasing partition $part"
+erase $part
+
+echo
+echo "flashing barebox.bin to $part"
+echo
+cp barebox.bin $part
+crc32 -f barebox.bin
+crc32 -f $part
arch/arm/boards/nhk8815/env/bin/update_kernel new file +8 -0
new file mode 100644
index 0000000..db0f4c2
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$uimage
+part=/dev/nand0.kernel
+
+. /env/bin/_update $1
arch/arm/boards/nhk8815/env/bin/update_root new file +8 -0
new file mode 100644
index 0000000..9530e84
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$jffs2
+part=/dev/nand0.rootfs
+
+. /env/bin/_update $1
arch/arm/boards/nhk8815/env/config new file +32 -0
new file mode 100644
index 0000000..2b50b25
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# can be either 'net' or 'flash'
+kernel=net
+root=net
+
+# use 'dhcp' todo dhcp in uboot and in kernel
+ip=dhcp
+
+#
+# setup default ethernet address
+#
+#eth0.serverip=192.168.23.108
+
+# Partition			Size	Start
+# XloaderTOC + X-Loader		256KB	0x00000000
+# Memory init function		256KB	0x00040000
+# Barebox + env			2MB	0x00080000
+# Kernel Image			3MB	0x00280000
+# JFFS2 Root filesystem		22MB	0x00580000
+# JFFS2 User Data		100MB	0x01b80000
+
+nand_parts="256k(xloader)ro,256k(meminit),2M(uboot),3M(kernel),22M(rootfs),100M(userfs),384k(free),128k(ubootenv)"
+
+uimage=uImage-nhk15
+
+# use 'dhcp' to do dhcp in uboot and in kernel
+ip=dhcp
+
+autoboot_timeout=3
+
+bootargs="root=/dev/ram0 console=ttyAMA1,115200n8 init=linuxrc"
arch/arm/boards/nhk8815/setup.c new file +106 -0

106 lines not on this page · raw message

arch/arm/configs/nhk8815_defconfig new file +232 -0

232 lines not on this page · raw message

arch/arm/mach-nomadik/Kconfig +13 -0
index 4cf3f7b..64894c8 100644
@@ -1,11 +1,24 @@
 if ARCH_NOMADIK
 
+config ARCH_TEXT_BASE
+	hex
+	default 0x03c00000 if MACH_NOMADIK_8815NHK
+
+config BOARDINFO
+	default "NHK8815" if MACH_NOMADIK_8815NHK
+
 choice
 	prompt "Nomadik boards"
 
+config MACH_NOMADIK_8815NHK
+	bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
+	select NOMADIK_8815
+	select COMMON_CLKDEV
+
 endchoice
 
 config NOMADIK_8815
 	bool
+	select ARM_AMBA
 
 endif
Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

Re: [PATCH 3/6] amba: add pl011

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD

+++ b/drivers/serial/amba-pl011.c

drivers/serial/amba-pl011.c new file +18 -0
@@ -0,0 +1,192 @@
+/*
+ * (C) Copyright 2000
+ * Rob Taylor, Flying Pig Systems. [email protected].
+ *
+ * (C) Copyright 2004
+ * ARM Ltd.
+ * Philippe Robin, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of

drivers/serial/amba-pl011.c line 28

Quoted 10 lines
drivers/serial/amba-pl011.c new file +10 -0
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */

We already have a driver for the pl010 in the tree, so I would expect arguments like 'this one is much more flexible, drop the old one', or 'the pl011 is totally different' (which doesn't seem to be the case).

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

Re: [PATCH 3/6] amba: add pl011

Quoted 27 lines · Sascha Hauer
Quoted 26 lines · Jean-Christophe PLAGNIOL-VILLARD

+++ b/drivers/serial/amba-pl011.c

drivers/serial/amba-pl011.c new file +24 -0
@@ -0,0 +1,192 @@
+/*
+ * (C) Copyright 2000
+ * Rob Taylor, Flying Pig Systems. [email protected].
+ *
+ * (C) Copyright 2004
+ * ARM Ltd.
+ * Philippe Robin, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
Quoted 8 lines

drivers/serial/amba-pl011.c line 28

Quoted 4 lines
drivers/serial/amba-pl011.c new file +4 -0
+ * MA 02111-1307 USA
+ */
+
+/* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */

We already have a driver for the pl010 in the tree, so I would expect arguments like 'this one is much more flexible, drop the old one', or 'the pl011 is totally different' (which doesn't seem to be the case).

Yes this new driver is flexible and multi instance
yes I'm working a new path to add the PL010 on it too
and one of the issue of the current one is that you can not calculate the baudrate based on the uart base clock on contrary on the new one who use the clk framework. So yes I plan to add the PL010 on it too but after I've put the clock framework on the sock that use it and drop the old one

Best Regards,
J.

Quoted 9 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox