Skip to contentSkip to conversation

Add basic support from ARM Versatile/PB

PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 1 message Dec 11, 2010

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

PATCH 1/1 Add basic support from ARM Versatile/PB

From: Alexey Zaytsev <[email protected]>

tested with qemu only

qemu-system-arm -M versatilepb -monitor null -kernel barebox -net nic -net user -tftp "<uImage-path>/" -serial stdio

add -nographic if you do not want the lcd via sdl

update:
- use default env
- move arm_timer.h as in the kernel
- add nor flash support
- udpate defconfig
- fix copyright copy from linux
- fix ARCH_TEXT_BASE

---
Hi,

HOw about setup a ftp or http with some testing kernel and rootfs that we can use with qemu to do automatic tests

so people can easy test their modification on other boards or arch with spend too much time

Best Regards,
J.

 arch/arm/Kconfig                                |    5 +
 arch/arm/Makefile                               |    2 +
 arch/arm/boards/versatile/Kconfig               |   10 +
 arch/arm/boards/versatile/Makefile              |    2 +
 arch/arm/boards/versatile/config.h              |    5 +
 arch/arm/boards/versatile/versatilepb.c         |   72 ++++
 arch/arm/configs/versatilepb_defconfig          |   48 +++
 arch/arm/include/asm/hardware/arm_timer.h       |   33 ++
 arch/arm/mach-versatile/Kconfig                 |   16 +
 arch/arm/mach-versatile/Makefile                |    2 +
 arch/arm/mach-versatile/core.c                  |  224 ++++++++++++
 arch/arm/mach-versatile/include/mach/clkdev.h   |    7 +
 arch/arm/mach-versatile/include/mach/debug_ll.h |   37 ++
 arch/arm/mach-versatile/include/mach/init.h     |    8 +
 arch/arm/mach-versatile/include/mach/platform.h |  417 +++++++++++++++++++++++
 15 files changed, 888 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/versatile/Kconfig
 create mode 100644 arch/arm/boards/versatile/Makefile
 create mode 100644 arch/arm/boards/versatile/config.h
 create mode 100644 arch/arm/boards/versatile/versatilepb.c
 create mode 100644 arch/arm/configs/versatilepb_defconfig
 create mode 100644 arch/arm/include/asm/hardware/arm_timer.h
 create mode 100644 arch/arm/mach-versatile/Kconfig
 create mode 100644 arch/arm/mach-versatile/Makefile
 create mode 100644 arch/arm/mach-versatile/core.c
 create mode 100644 arch/arm/mach-versatile/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-versatile/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-versatile/include/mach/init.h
 create mode 100644 arch/arm/mach-versatile/include/mach/platform.h
arch/arm/Kconfig +5 -0
index 8cb86cb..f1536a5 100644
@@ -61,6 +61,10 @@ config ARCH_S3C24xx
 	select CPU_ARM920T
 	select GENERIC_GPIO
 
+config ARCH_VERSATILE
+	bool "ARM Versatile boards (ARM926EJ-S)"
+	select CPU_ARM926T
+
 endchoice
 
 source arch/arm/cpu/Kconfig
@@ -72,6 +76,7 @@ source arch/arm/mach-netx/Kconfig
 source arch/arm/mach-nomadik/Kconfig
 source arch/arm/mach-omap/Kconfig
 source arch/arm/mach-s3c24xx/Kconfig
+source arch/arm/mach-versatile/Kconfig
 
 config AEABI
 	bool "Use the ARM EABI to compile barebox"
arch/arm/Makefile +2 -0
index 9729c23..7b68f98 100644
@@ -46,6 +46,7 @@ machine-$(CONFIG_ARCH_NOMADIK)		:= nomadik
 machine-$(CONFIG_ARCH_NETX)		:= netx
 machine-$(CONFIG_ARCH_OMAP)		:= omap
 machine-$(CONFIG_ARCH_S3C24xx)		:= s3c24xx
+machine-$(CONFIG_ARCH_VERSATILE)	:= versatile
 
 # Board directory name.  This list is sorted alphanumerically
 # by CONFIG_* macro name.
@@ -91,6 +92,7 @@ board-$(CONFIG_MACH_CHUMBY)			:= chumby_falconwing
 board-$(CONFIG_MACH_FREESCALE_MX51_PDK)		:= freescale-mx51-pdk
 board-$(CONFIG_MACH_GUF_CUPID)			:= guf-cupid
 board-$(CONFIG_MACH_MINI2440)			:= mini2440
+board-$(CONFIG_MACH_VERSATILEPB)		:= versatile
 
 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 
arch/arm/boards/versatile/Kconfig new file +10 -0
new file mode 100644
index 0000000..2428901
@@ -0,0 +1,10 @@
+
+if MACH_VERSATILEPB
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x01000000
+
+config BOARDINFO
+	default "ARM Versatile/PB (ARM926EJ-S)"
+endif
arch/arm/boards/versatile/Makefile new file +2 -0
new file mode 100644
index 0000000..a17aed3
@@ -0,0 +1,2 @@
+
+obj-$(CONFIG_MACH_VERSATILEPB) += versatilepb.o
arch/arm/boards/versatile/config.h new file +5 -0
new file mode 100644
index 0000000..25bb18f
@@ -0,0 +1,5 @@
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
arch/arm/boards/versatile/versatilepb.c new file +72 -0

72 lines not on this page · raw message

arch/arm/configs/versatilepb_defconfig new file +48 -0

48 lines not on this page · raw message

arch/arm/include/asm/hardware/arm_timer.h new file +33 -0
new file mode 100644
index 0000000..0433279
@@ -0,0 +1,33 @@
+#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
+#define __ASM_ARM_HARDWARE_ARM_TIMER_H
+
+/*
+ * From Linux v2.6.35
+ * arch/arm/include/asm/hardware/arm_timer.h
+ *
+ * ARM timer implementation, found in Integrator, Versatile and Realview
+ * platforms.  Not all platforms support all registers and bits in these
+ * registers, so we mark them with A for Integrator AP, C for Integrator
+ * CP, V for Versatile and R for Realview.
+ *
+ * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
+ * can have 16-bit or 32-bit selectable via a bit in the control register.
+ */
+#define TIMER_LOAD	0x00			/* ACVR rw */
+#define TIMER_VALUE	0x04			/* ACVR ro */
+#define TIMER_CTRL	0x08			/* ACVR rw */
+#define TIMER_CTRL_ONESHOT	(1 << 0)	/*  CVR */
+#define TIMER_CTRL_32BIT	(1 << 1)	/*  CVR */
+#define TIMER_CTRL_DIV1		(0 << 2)	/* ACVR */
+#define TIMER_CTRL_DIV16	(1 << 2)	/* ACVR */
+#define TIMER_CTRL_DIV256	(2 << 2)	/* ACVR */
+#define TIMER_CTRL_IE		(1 << 5)	/*   VR */
+#define TIMER_CTRL_PERIODIC	(1 << 6)	/* ACVR */
+#define TIMER_CTRL_ENABLE	(1 << 7)	/* ACVR */
+
+#define TIMER_INTCLR	0x0c			/* ACVR wo */
+#define TIMER_RIS	0x10			/*  CVR ro */
+#define TIMER_MIS	0x14			/*  CVR ro */
+#define TIMER_BGLOAD	0x18			/*  CVR rw */
+
+#endif
arch/arm/mach-versatile/Kconfig new file +16 -0
new file mode 100644
index 0000000..9a1bf95
@@ -0,0 +1,16 @@
+
+if ARCH_VERSATILE
+
+choice
+	prompt "ARM Board type"
+
+config MACH_VERSATILEPB
+	bool "ARM Versatile/PB (ARM926EJ-S)"
+	select ARM_AMBA
+	select CLKDEV_LOOKUP
+
+endchoice
+
+source arch/arm/boards/versatile/Kconfig
+
+endif
arch/arm/mach-versatile/Makefile new file +2 -0
new file mode 100644
index 0000000..a8da54c
@@ -0,0 +1,2 @@
+
+obj-y += core.o
arch/arm/mach-versatile/core.c new file +224 -0

224 lines not on this page · raw message

arch/arm/mach-versatile/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-versatile/include/mach/debug_ll.h new file +37 -0
new file mode 100644
index 0000000..514fcfb
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 B Labs Ltd
+ * Author: Alexey Zaytsev <[email protected]>
+ *
+ * barebox 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * barebox 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 barebox.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define   __MACH_DEBUG_LL_H__
+
+#include <linux/amba/serial.h>
+#include <asm/io.h>
+
+static inline void putc(char c)
+{
+	/* Wait until there is space in the FIFO */
+	while (readl(0x101F1000 + UART01x_FR) & UART01x_FR_TXFF);
+
+	/* Send the character */
+	writel(c, 0x101F1000 + UART01x_DR);
+
+	/* Wait to make sure it hits the line, in case we die too soon. */
+	while (readl(0x101F1000 + UART01x_FR) & UART01x_FR_TXFF);
+}
+
+#endif
arch/arm/mach-versatile/include/mach/init.h new file +8 -0
new file mode 100644
index 0000000..878cde0
@@ -0,0 +1,8 @@
+
+#ifndef __VERSATILE_INIT_H__
+#define __VERSATILE_INIT_H__
+
+void versatile_add_sdram(u32 size);
+void versatile_register_uart(unsigned id);
+
+#endif
arch/arm/mach-versatile/include/mach/platform.h new file +417 -0

417 lines not on this page · raw message

Signature · 7 lines
1.7.2.3


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