Skip to contentSkip to conversation

Add basic support from ARM Versatile/PB

PATCH Superseded Alexey Zaytsev 4 participants 7 messages Oct 10, 2010 – Oct 11, 2010

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

---

Hi.

It seems that barebox does not run on any ARM machines provided by QEMU. This patch adds basic Versatile/PB support. It is far from being complete and has not been tested on real hardware, but seems to work fine in QEMU.

Please notice, that you need to set CONFIG_VERSATILE_SMC91C111 in order to have networking in QEMU, as it does not provide smc91x found on the real hardware.

For a queck test, run:

qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user

 arch/arm/Kconfig                                |    4 
 arch/arm/Makefile                               |    2 
 arch/arm/boards/versatile/Kconfig               |   21 +
 arch/arm/boards/versatile/Makefile              |    2 
 arch/arm/boards/versatile/config.h              |    5 
 arch/arm/boards/versatile/env/bin/init          |    1 
 arch/arm/boards/versatile/versatilepb.c         |   56 +++
 arch/arm/configs/versatilepb_defconfig          |   12 +
 arch/arm/include/asm/arm_timer.h                |   33 ++
 arch/arm/mach-versatile/Kconfig                 |   16 +
 arch/arm/mach-versatile/Makefile                |    2 
 arch/arm/mach-versatile/core.c                  |  217 ++++++++++++
 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     |    9 
 arch/arm/mach-versatile/include/mach/platform.h |  417 +++++++++++++++++++++++
 16 files changed, 841 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/env/bin/init
 create mode 100644 arch/arm/boards/versatile/versatilepb.c
 create mode 100644 arch/arm/configs/versatilepb_defconfig
 create mode 100644 arch/arm/include/asm/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 +4 -0
index fa37036..d90246a 100644
@@ -56,6 +56,9 @@ config ARCH_S3C24xx
 	bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
 	select CPU_ARM920T
 
+config ARCH_VERSATILE
+	bool "ARM Versatile boards (ARM926EJ-S)"
+	select CPU_ARM926T
 endchoice
 
 source arch/arm/cpu/Kconfig
@@ -66,6 +69,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 77b6cf4..6ad14e7 100644
@@ -45,6 +45,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.
@@ -80,6 +81,7 @@ board-$(CONFIG_MACH_PCM043)			:= pcm043
 board-$(CONFIG_MACH_PM9263)			:= pm9263
 board-$(CONFIG_MACH_SCB9328)			:= scb9328
 board-$(CONFIG_MACH_NESO)			:= guf-neso
+board-$(CONFIG_MACH_VERSATILEPB)		:= versatile
 
 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 
arch/arm/boards/versatile/Kconfig new file +21 -0
new file mode 100644
index 0000000..d5da87d
@@ -0,0 +1,21 @@
+
+
+if MACH_VERSATILEPB
+
+config ARCH_TEXT_BASE
+	hex
+	default 0
+
+config BOARDINFO
+	default "ARM Versatile/PB (ARM926EJ-S)"
+endif
+
+config VERSATILE_SMC91C111
+	bool "Use smc91c111 instead of smc91x (for QEMU)"
+	default 0
+	help
+	 Enable this option to run barebox inside qemu.
+	 Real versatile boards are equipped with smc911x,
+	 but qemu only provides smc91111, which is a bit different.
+
+
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/env/bin/init new file +1 -0
new file mode 100644
index 0000000..224a6b4
@@ -0,0 +1 @@
+# Dummy Init environment script
arch/arm/boards/versatile/versatilepb.c new file +56 -0

56 lines not on this page · raw message

arch/arm/configs/versatilepb_defconfig new file +12 -0
new file mode 100644
index 0000000..f505ac6
@@ -0,0 +1,12 @@
+
+CONFIG_ARCH_VERSATILE=y
+CONFIG_MACH_VERSATILEPB=y
+
+CONFIG_TEXT_BASE=0x500000
+CONFIG_HAVE_CONFIGURABLE_MEMORY_LAYOUT=y
+CONFIG_MEMORY_LAYOUT_DEFAULT=y
+CONFIG_PROMPT="versatilepb> "
+CONFIG_DEFAULT_ENVIRONMENT=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/versatile/env"
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_DRIVER_NET_SMC911X=y
arch/arm/include/asm/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 +217 -0

217 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 +9 -0
new file mode 100644
index 0000000..7772e85
@@ -0,0 +1,9 @@
+
+#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

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

#1 lore raw

Hi Alexey,

Quoted 2 lines · Alexey Zaytsev

---

[snip]

arch/arm/boards/versatile/Kconfig line 19

Quoted 7 lines
arch/arm/boards/versatile/Kconfig new file +7 -0
+config VERSATILE_SMC91C111
+	bool "Use smc91c111 instead of smc91x (for QEMU)"
+	default 0
+	help
+	 Enable this option to run barebox inside qemu.
+	 Real versatile boards are equipped with smc911x,
+	 but qemu only provides smc91111, which is a bit different.

s/smc91111/smc9111/?

baruch

Signature · 8 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 16 lines · Baruch Siach

Hi Alexey,

Quoted 2 lines · Alexey Zaytsev

---

[snip]

Quoted 7 lines

+config VERSATILE_SMC91C111
+     bool "Use smc91c111 instead of smc91x (for QEMU)"
+     default 0
+     help
+      Enable this option to run barebox inside qemu.
+      Real versatile boards are equipped with smc911x,
+      but qemu only provides smc91111, which is a bit different.

Quoted 2 lines

s/smc91111/smc9111/?

The driver is implemented in smc91111.c, but it should probably be smc91c111.

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

#3 lore raw
In reply to Alexey Zaytsev
Quoted 10 lines · Alexey Zaytsev

---

Hi.

It seems that barebox does not run on any ARM machines provided by QEMU. This patch adds basic Versatile/PB support. It is far from being complete and has not been tested on real hardware, but seems to work fine in QEMU.

Quoted 7 lines

Please notice, that you need to set CONFIG_VERSATILE_SMC91C111 in order to have networking in QEMU, as it does not provide smc91x found on the real hardware.

For a queck test, run:

qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user

this must be in a doc

please use defaultenv and enable more functionnability

as we can use it as ref board for emulation

Quoted 87 lines

 arch/arm/Kconfig                                |    4 
 arch/arm/Makefile                               |    2 
 arch/arm/boards/versatile/Kconfig               |   21 +
 arch/arm/boards/versatile/Makefile              |    2 
 arch/arm/boards/versatile/config.h              |    5 
 arch/arm/boards/versatile/env/bin/init          |    1 
 arch/arm/boards/versatile/versatilepb.c         |   56 +++
 arch/arm/configs/versatilepb_defconfig          |   12 +
 arch/arm/include/asm/arm_timer.h                |   33 ++
 arch/arm/mach-versatile/Kconfig                 |   16 +
 arch/arm/mach-versatile/Makefile                |    2 
 arch/arm/mach-versatile/core.c                  |  217 ++++++++++++
 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     |    9 
 arch/arm/mach-versatile/include/mach/platform.h |  417 +++++++++++++++++++++++
 16 files changed, 841 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/env/bin/init
 create mode 100644 arch/arm/boards/versatile/versatilepb.c
 create mode 100644 arch/arm/configs/versatilepb_defconfig
 create mode 100644 arch/arm/include/asm/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 +4 -0
index fa37036..d90246a 100644
@@ -56,6 +56,9 @@ config ARCH_S3C24xx
 	bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
 	select CPU_ARM920T
 
+config ARCH_VERSATILE
+	bool "ARM Versatile boards (ARM926EJ-S)"
+	select CPU_ARM926T
 endchoice
 
 source arch/arm/cpu/Kconfig
@@ -66,6 +69,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 77b6cf4..6ad14e7 100644
@@ -45,6 +45,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.
@@ -80,6 +81,7 @@ board-$(CONFIG_MACH_PCM043)			:= pcm043
 board-$(CONFIG_MACH_PM9263)			:= pm9263
 board-$(CONFIG_MACH_SCB9328)			:= scb9328
 board-$(CONFIG_MACH_NESO)			:= guf-neso
+board-$(CONFIG_MACH_VERSATILEPB)		:= versatile
 
 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 
arch/arm/boards/versatile/Kconfig new file +5 -0
new file mode 100644
index 0000000..d5da87d
@@ -0,0 +1,21 @@
+
+
+if MACH_VERSATILEPB
+
+config ARCH_TEXT_BASE

arch/arm/boards/versatile/Kconfig line 15

Quoted 10 lines
arch/arm/boards/versatile/Kconfig new file +10 -0
+	hex
+	default 0
+
+config BOARDINFO
+	default "ARM Versatile/PB (ARM926EJ-S)"
+endif
+
+config VERSATILE_SMC91C111
+	bool "Use smc91c111 instead of smc91x (for QEMU)"
+	default 0

??

arch/arm/boards/versatile/Kconfig line 19

Quoted 4 lines
arch/arm/boards/versatile/Kconfig new file +4 -0
+	help
+	 Enable this option to run barebox inside qemu.
+	 Real versatile boards are equipped with smc911x,
+	 but qemu only provides smc91111, which is a bit different.

it will be beter to modify the ressources depending on the drivers enabled

and nake it exclusive

Quoted 24 lines
arch/arm/boards/versatile/Kconfig new file +2 -0
+
+
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/env/bin/init new file +0 -0
new file mode 100644
index 0000000..224a6b4

arch/arm/boards/versatile/env/bin/init

Quoted 1 line
arch/arm/boards/versatile/env/bin/init new file +0 -1
--- /dev/null

+ sdram_dev.size = size;

arch/arm/boards/versatile/env/bin/init

Quoted 7 lines
arch/arm/boards/versatile/env/bin/init new file +7 -0
+	register_device(&sdram_dev);
+	armlinux_add_dram(&sdram_dev);
+}
+
+/* 4 uarts, yay! */
+static struct device_d uart0_serial_device = {
+	.id = 1,

why not start at 0?

btw there is a lots of whitespace could you fix them

Best Regards,
J.

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

#4 lore raw
Quoted 34 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · Alexey Zaytsev

---

Hi.

It seems that barebox does not run on any ARM machines provided by QEMU. This patch adds basic Versatile/PB support. It is far from being complete and has not been tested on real hardware, but seems to work fine in QEMU.

Quoted 7 lines

Please notice, that you need to set CONFIG_VERSATILE_SMC91C111 in order to have networking in QEMU, as it does not provide smc91x found on the real hardware.

For a queck test, run:

qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user

this must be in a doc

please use defaultenv and enable more functionnability

as we can use it as ref board for emulation

arch/arm/boards/versatile/Kconfig line 15

Quoted 10 lines
arch/arm/boards/versatile/Kconfig new file +8 -0
+
+config BOARDINFO
+	default "ARM Versatile/PB (ARM926EJ-S)"
+endif
+
+config VERSATILE_SMC91C111
+	bool "Use smc91c111 instead of smc91x (for QEMU)"
+	default 0

??

Quoted 5 lines

arch/arm/boards/versatile/Kconfig line 19

Quoted 4 lines
arch/arm/boards/versatile/Kconfig new file +4 -0
+	help
+	 Enable this option to run barebox inside qemu.
+	 Real versatile boards are equipped with smc911x,
+	 but qemu only provides smc91111, which is a bit different.

it will be beter to modify the ressources depending on the drivers enabled

I think it's ok the way Alexey did this. It's a good place to document that we need two different ethernet drivers depending on native/qemu compilation.

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
#5 lore raw
Quoted 41 lines · Sascha Hauer
Quoted 34 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · Alexey Zaytsev

---

Hi.

It seems that barebox does not run on any ARM machines provided by QEMU. This patch adds basic Versatile/PB support. It is far from being complete and has not been tested on real hardware, but seems to work fine in QEMU.

Quoted 7 lines

Please notice, that you need to set CONFIG_VERSATILE_SMC91C111 in order to have networking in QEMU, as it does not provide smc91x found on the real hardware.

For a queck test, run:

qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user

this must be in a doc

please use defaultenv and enable more functionnability

as we can use it as ref board for emulation

arch/arm/boards/versatile/Kconfig line 15

Quoted 10 lines
arch/arm/boards/versatile/Kconfig new file +8 -0
+
+config BOARDINFO
+	default "ARM Versatile/PB (ARM926EJ-S)"
+endif
+
+config VERSATILE_SMC91C111
+	bool "Use smc91c111 instead of smc91x (for QEMU)"
+	default 0

??

Quoted 5 lines

arch/arm/boards/versatile/Kconfig line 19

Quoted 4 lines
arch/arm/boards/versatile/Kconfig new file +4 -0
+	help
+	 Enable this option to run barebox inside qemu.
+	 Real versatile boards are equipped with smc911x,
+	 but qemu only provides smc91111, which is a bit different.

it will be beter to modify the ressources depending on the drivers enabled

Quoted 3 lines

I think it's ok the way Alexey did this. It's a good place to document that we need two different ethernet drivers depending on native/qemu compilation.

yeah but just enable the drivers is enough but we need to make it exclusive via Kconfig otherwise it will be confusing

Best Regards,
J.

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

#6 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 113 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · Alexey Zaytsev

---

Hi.

It seems that barebox does not run on any ARM machines provided by QEMU. This patch adds basic Versatile/PB support. It is far from being complete and has not been tested on real hardware, but seems to work fine in QEMU.

Quoted 7 lines

Please notice, that you need to set CONFIG_VERSATILE_SMC91C111 in order to have networking in QEMU, as it does not provide smc91x found on the real hardware.

For a queck test, run:

      qemu-system-arm -kernel barebox.bin -M versatilepb -cpu arm926 -nographic -m 64 -net nic,model=smc91c111 -net user

this must be in a doc

please use defaultenv and enable more functionnability

as we can use it as ref board for emulation

Quoted 90 lines

 arch/arm/Kconfig                                |    4 arch/arm/Makefile                               |    2

 arch/arm/boards/versatile/Kconfig               |   21 +
 arch/arm/boards/versatile/Makefile              |    2
 arch/arm/boards/versatile/config.h              |    5
 arch/arm/boards/versatile/env/bin/init          |    1
 arch/arm/boards/versatile/versatilepb.c         |   56 +++
 arch/arm/configs/versatilepb_defconfig          |   12 +
 arch/arm/include/asm/arm_timer.h                |   33 ++
 arch/arm/mach-versatile/Kconfig                 |   16 +
 arch/arm/mach-versatile/Makefile                |    2

 arch/arm/mach-versatile/core.c                  |  217 ++++++++++++ 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     |    9 arch/arm/mach-versatile/include/mach/platform.h |  417 +++++++++++++++++++++++

 16 files changed, 841 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/env/bin/init create mode 100644 arch/arm/boards/versatile/versatilepb.c create mode 100644 arch/arm/configs/versatilepb_defconfig create mode 100644 arch/arm/include/asm/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 +0 -0
index fa37036..d90246a 100644
@@ -56,6 +56,9 @@ config ARCH_S3C24xx

      bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" select CPU_ARM920T

+config ARCH_VERSATILE
+     bool "ARM Versatile boards (ARM926EJ-S)"
+     select CPU_ARM926T
 endchoice

 source arch/arm/cpu/Kconfig

arch/arm/Kconfig +0 -0
@@ -66,6 +69,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 +0 -0
index 77b6cf4..6ad14e7 100644
@@ -45,6 +45,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.
arch/arm/Makefile +0 -0
@@ -80,6 +81,7 @@ board-$(CONFIG_MACH_PCM043)                 := pcm043

 board-$(CONFIG_MACH_PM9263)                  := pm9263 board-$(CONFIG_MACH_SCB9328)                 := scb9328 board-$(CONFIG_MACH_NESO)                    := guf-neso +board-$(CONFIG_MACH_VERSATILEPB)             := versatile

 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))

arch/arm/boards/versatile/Kconfig new file +8 -0
new file mode 100644
index 0000000..d5da87d
@@ -0,0 +1,21 @@
+
+
+if MACH_VERSATILEPB
+
+config ARCH_TEXT_BASE
+     hex
+     default 0
+
Quoted 8 lines

arch/arm/boards/versatile/Kconfig line 15

Quoted 7 lines
arch/arm/boards/versatile/Kconfig new file +7 -0
+config BOARDINFO
+     default "ARM Versatile/PB (ARM926EJ-S)"
+endif
+
+config VERSATILE_SMC91C111
+     bool "Use smc91c111 instead of smc91x (for QEMU)"
+     default 0

??

Will remove.

Quoted 7 lines

arch/arm/boards/versatile/Kconfig line 19

Quoted 4 lines
arch/arm/boards/versatile/Kconfig new file +4 -0
+     help
+      Enable this option to run barebox inside qemu.
+      Real versatile boards are equipped with smc911x,
+      but qemu only provides smc91111, which is a bit different.

it will be beter to modify the ressources depending on the drivers enabled

and nake it exclusive

Can't agree here, in my understanding, the board definition should not depend on the drivers enabled. It might be a good idea to enable the right driver depending on this option, but I'm not sure if this is doable without forcing the ethernet driver always on.

Quoted 26 lines
Quoted 24 lines
arch/arm/boards/versatile/Kconfig new file +2 -0
+
+
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/env/bin/init new file +0 -0
new file mode 100644
index 0000000..224a6b4

arch/arm/boards/versatile/env/bin/init

Quoted 1 line
arch/arm/boards/versatile/env/bin/init new file +0 -1
--- /dev/null

 +      sdram_dev.size = size;

Quoted 8 lines

arch/arm/boards/versatile/env/bin/init

Quoted 7 lines

+     register_device(&sdram_dev);
+     armlinux_add_dram(&sdram_dev);

arch/arm/boards/versatile/env/bin/init new file +5 -0
+}
+
+/* 4 uarts, yay! */
+static struct device_d uart0_serial_device = {
+     .id = 1,

why not start at 0?

Will fix.

Quoted 3 lines

btw there is a lots of whitespace could you fix them

Will fix.

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