* [Buildroot] [RFC] Development around Coldfire
@ 2012-04-10 16:10 Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 1/5] arch: re-enable m68k and add a few architecture variants Thomas Petazzoni
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
Hello,
The work enclosed in the patches is not fully-working yet, but I
wanted to share it so that others can help, and to avoid others in
trying to do the same thing.
Basically, the goal of this patch set is to add a defconfig for the
MCF5208 Coldfire platform emulated by Qemu, which is a non-MMU
platform.
The proposed defconfig generates a system where the kernel boots, but
panics when the first userspace program exits (the kernel complains
that someone tried to kill init).
I think patches 1 to 4 could be merged now, while the 5th patch
(adding the defconfig) needs more work to fix this problem before
being submitted. The other annoying part is that a patch for Qemu is
also needed (it is part of this 5th patch).
Note that I have also done a similar work on the AT91 ARM noMMU
platform emulated by SkyEye. I hope to send the patches soon.
Thomas
The following changes since commit 8876b6751e0bc19a3754290061808f0f8420708e:
Fix makedevs to allow longer path names (2012-04-08 19:46:52 +0200)
are available in the git repository at:
git://git.free-electrons.com/users/thomas-petazzoni/buildroot.git for-2012.05/coldfire
Thomas Petazzoni (5):
arch: re-enable m68k and add a few architecture variants
toolchain: add Coldfire external toolchain from Sourcery CodeBench
toolchain: add m68k to the list of arch that can work without MMU
busybox: enable useful hush suboptions
board: add support for Coldfire MCF5208EVB board emulated by Qemu
.../qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch | 25 +++++++
board/qemu/m68k-mcf5208evb/linux-3.3.config | 71 ++++++++++++++++++++
.../qemu-mcfint-masking-support.patch | 42 ++++++++++++
board/qemu/m68k-mcf5208evb/readme.txt | 14 ++++
configs/qemu_m68k_mcf5208_evb_defconfig | 14 ++++
package/busybox/busybox.mk | 5 ++
target/Config.in.arch | 41 +++++++++++-
toolchain/toolchain-common.in | 2 +-
toolchain/toolchain-external/Config.in | 41 +++++++++++
toolchain/toolchain-external/ext-tool.mk | 3 +
10 files changed, 256 insertions(+), 2 deletions(-)
create mode 100644 board/qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch
create mode 100644 board/qemu/m68k-mcf5208evb/linux-3.3.config
create mode 100644 board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch
create mode 100644 board/qemu/m68k-mcf5208evb/readme.txt
create mode 100644 configs/qemu_m68k_mcf5208_evb_defconfig
Thanks,
--
Thomas Petazzoni
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/5] arch: re-enable m68k and add a few architecture variants
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
@ 2012-04-10 16:10 ` Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench Thomas Petazzoni
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
target/Config.in.arch | 41 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/target/Config.in.arch b/target/Config.in.arch
index a2c0037..7efd672 100644
--- a/target/Config.in.arch
+++ b/target/Config.in.arch
@@ -48,7 +48,6 @@ config BR2_i386
config BR2_m68k
bool "m68k"
- depends on BROKEN # ice in uclibc / inet_ntoa_r
help
Motorola 68000 family microprocessor
http://en.wikipedia.org/wiki/M68k
@@ -577,6 +576,40 @@ config BR2_powerpc_SPE
depends on BR2_powerpc_8540 || BR2_powerpc_8548 || BR2_powerpc_e500mc
endchoice
+choice
+ prompt "Target Architecture Variant"
+ depends on BR2_m68k
+ default BR2_generic_m68k
+ help
+ Specific CPU variant to use
+config BR2_generic_m68k
+ bool "generic"
+config BR2_m68k_68000
+ bool "m68k 68000"
+config BR2_m68k_68010
+ bool "m68k 68010"
+config BR2_m68k_68020
+ bool "m68k 68020"
+config BR2_m68k_68030
+ bool "m68k 68030"
+config BR2_m68k_68040
+ bool "m68k 68030"
+config BR2_m68k_68060
+ bool "m68k 68030"
+config BR2_m68k_5206
+ bool "coldfire 5206"
+config BR2_m68k_51qe
+ bool "coldfire 51qe"
+config BR2_m68k_5206e
+ bool "coldfire 5206e"
+config BR2_m68k_5208
+ bool "coldfire 5208"
+config BR2_m68k_5307
+ bool "coldfire 5307"
+config BR2_m68k_5407
+ bool "coldfire 5407"
+endchoice
+
config BR2_ARCH
string
default "arm" if BR2_arm
@@ -845,3 +878,9 @@ config BR2_GCC_TARGET_CPU
default sparchfleonv8 if BR2_sparc_sparchfleonv8
default sparcsfleon if BR2_sparc_sparcsfleon
default sparcsfleonv8 if BR2_sparc_sparcsfleonv8
+ default 5206 if BR2_m68k_5206
+ default 51qe if BR2_m68k_51qe
+ default 5206e if BR2_m68k_5206e
+ default 5208 if BR2_m68k_5208
+ default 5307 if BR2_m68k_5307
+ default 5407 if BR2_m68k_5407
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 1/5] arch: re-enable m68k and add a few architecture variants Thomas Petazzoni
@ 2012-04-10 16:10 ` Thomas Petazzoni
2012-04-17 22:54 ` Arnout Vandecappelle
2012-04-10 16:10 ` [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU Thomas Petazzoni
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-external/Config.in | 41 ++++++++++++++++++++++++++++++
toolchain/toolchain-external/ext-tool.mk | 3 ++
2 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 49ea7fa..d7b694a 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -470,6 +470,46 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2
Toolchain for the Microblaze architecture, from
http://wiki.xilinx.com/mb-gnu-tools
+config BR2_TOOLCHAIN_EXTERNAL_SOURCERY_CODEBENCH_FREESCALE_COLDFIRE_201109
+ bool "Sourcery CodeBench Freescale Coldfire 2011.09"
+ depends on BR2_m68k
+ select BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+ select BR2_INSTALL_LIBSTDCPP
+ select BR2_LARGEFILE
+ select BR2_INET_RPC
+ select BR2_USE_WCHAR
+ select BR2_TOOLCHAIN_HAS_THREADS
+ select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
+ help
+ Sourcery CodeBench toolchain for the m68k Coldfire
+ architecture, from Mentor Graphics. It uses gcc 4.6.1,
+ binutils 2.21.53, uClibc 0.9.30, gdb 7.2.50 and kernel
+ headers 3.0.1. It has support for the following variants:
+ - MCF5206
+ - MCF51QE
+ - MCF5206E
+ - MCF5208
+ - MCF5307
+ - MCF532X/7X
+ - MCF5407
+ - MCF54455
+ - MCF5206, with separated data
+ - MCF5206, with ID-shared-library
+ - MCF51QE, with separated data
+ - MCF51QE, with ID-shared-library
+ - MCF5206E, with separated data
+ - MCF5206E, with ID-shared-library
+ - MCF5208, with separated data
+ - MCF5208, with ID-shared-library
+ - MCF5307, with separated data
+ - MCF5307, with ID-shared-library
+ - MCF532X/7X, with separated data
+ - MCF532X/7X, with ID-shared-library
+ - MCF5407, with separated data
+ - MCF5407, with ID-shared-library
+ - MCF54455, with separated data
+ - MCF54455, with ID-shared-library
+
config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
bool "Custom toolchain"
help
@@ -525,6 +565,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "bfin-linux-uclibc" if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2010RC1 && BR2_BFIN_FDPIC
default "bfin-uclinux" if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && !BR2_BFIN_FDPIC
default "bfin-linux-uclibc" if BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2011R1 && BR2_BFIN_FDPIC
+ default "m68k-uclinux" if BR2_TOOLCHAIN_EXTERNAL_SOURCERY_CODEBENCH_FREESCALE_COLDFIRE_201109
default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 0a997a5..5700b0e 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -248,6 +248,9 @@ TOOLCHAIN_EXTERNAL_SOURCE=microblazeel-unknown-linux-gnu.tgz
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2),y)
TOOLCHAIN_EXTERNAL_SITE=http://git.xilinx.com/?p=xldk/microblaze_v2.0.git;a=blob;h=71e031ae990e063a5718f90d30cf97ad85e2f565;hb=569081301f0f1d8d3b24335a364e8ff1774190d4;f=
TOOLCHAIN_EXTERNAL_SOURCE=microblaze-unknown-linux-gnu.tgz
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SOURCERY_CODEBENCH_FREESCALE_COLDFIRE_201109),y)
+TOOLCHAIN_EXTERNAL_SITE=???
+TOOLCHAIN_EXTERNAL_SOURCE=freescale-coldfire-2011.09-23-m68k-uclinux-i686-pc-linux-gnu.tar.bz2
else
# A value must be set (even if unused), otherwise the
# $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 1/5] arch: re-enable m68k and add a few architecture variants Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench Thomas Petazzoni
@ 2012-04-10 16:10 ` Thomas Petazzoni
2012-04-10 17:28 ` Gustavo Zacarias
2012-04-10 16:10 ` [Buildroot] [PATCH 4/5] busybox: enable useful hush suboptions Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 5/5] board: add support for Coldfire MCF5208EVB board emulated by Qemu Thomas Petazzoni
4 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
The early m68k had no MMU, later m68k had MMUs, but Coldfires don't
have MMU.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
toolchain/toolchain-common.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index fb87a88..f29ccae 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -75,7 +75,7 @@ config BR2_NEEDS_GETTEXT_IF_LOCALE
default y if (BR2_NEEDS_GETTEXT && BR2_ENABLE_LOCALE)
config BR2_USE_MMU
- bool "Enable MMU support" if BR2_arm || BR2_armeb || BR2_mips || BR2_mipsel || BR2_sh || BR2_xtensa
+ bool "Enable MMU support" if BR2_arm || BR2_armeb || BR2_mips || BR2_mipsel || BR2_sh || BR2_xtensa || BR2_m68k
default y if !BR2_bfin
help
If your target has a MMU, you should say Y here. If you
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 4/5] busybox: enable useful hush suboptions
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
` (2 preceding siblings ...)
2012-04-10 16:10 ` [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU Thomas Petazzoni
@ 2012-04-10 16:10 ` Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 5/5] board: add support for Coldfire MCF5208EVB board emulated by Qemu Thomas Petazzoni
4 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
Our default Busybox configuration enables the ash shell, but since
this shell doesn't work on noMMU platforms, we enable the hush shell
instead. However, the hush shell by itself isn't very useful without
interactive mode, support for loops, if and case statements, etc. So
we enable them.
The drawback of this method is that those options are forcefully
selected, regarless of the users choices. The other solution would be
to have a separate Busybox configuration for noMMU platforms, or work
with fragments of Busybox configurations.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/busybox/busybox.mk | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 59448d5..7e05ead 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -131,6 +131,11 @@ define BUSYBOX_DISABLE_MMU_APPLETS
$(call KCONFIG_DISABLE_OPT,CONFIG_SWAPONOFF,$(BUSYBOX_BUILD_CONFIG))
$(call KCONFIG_DISABLE_OPT,CONFIG_ASH,$(BUSYBOX_BUILD_CONFIG))
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_IF,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_LOOPS,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_CASE,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_FUNCTIONS,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_INTERACTIVE,$(BUSYBOX_BUILD_CONFIG))
endef
endif
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 5/5] board: add support for Coldfire MCF5208EVB board emulated by Qemu
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
` (3 preceding siblings ...)
2012-04-10 16:10 ` [Buildroot] [PATCH 4/5] busybox: enable useful hush suboptions Thomas Petazzoni
@ 2012-04-10 16:10 ` Thomas Petazzoni
4 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-10 16:10 UTC (permalink / raw)
To: buildroot
The support requires a slightly patched Qemu, and doesn't work nicely
yet: the kernel crashes when the first userspace programs exits.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
.../qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch | 25 +++++++
board/qemu/m68k-mcf5208evb/linux-3.3.config | 71 ++++++++++++++++++++
.../qemu-mcfint-masking-support.patch | 42 ++++++++++++
board/qemu/m68k-mcf5208evb/readme.txt | 14 ++++
configs/qemu_m68k_mcf5208_evb_defconfig | 14 ++++
5 files changed, 166 insertions(+), 0 deletions(-)
create mode 100644 board/qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch
create mode 100644 board/qemu/m68k-mcf5208evb/linux-3.3.config
create mode 100644 board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch
create mode 100644 board/qemu/m68k-mcf5208evb/readme.txt
create mode 100644 configs/qemu_m68k_mcf5208_evb_defconfig
diff --git a/board/qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch b/board/qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch
new file mode 100644
index 0000000..70d935c
--- /dev/null
+++ b/board/qemu/m68k-mcf5208evb/linux-3.3-sw-ustack.patch
@@ -0,0 +1,25 @@
+m68k: enabled software emulation of separate supervisor/user stack
+
+Recent Coldfires have separate supervisor and user stack pointers, but
+since older Coldfires didn't have that, the Linux kernel has a kind of
+emulation mechanism for those pointers.
+
+Apparently, according to the Kconfig.cpu file, the 5208 is supposed to
+support such separate pointers, but Qemu doesn't implement it. So we
+cheat a bit here and force the usage of emulated separate stack
+pointers.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
+index 8a9c767..b9ff29a 100644
+--- a/arch/m68k/Kconfig.cpu
++++ b/arch/m68k/Kconfig.cpu
+@@ -146,6 +146,7 @@ config M520x
+ depends on !MMU
+ select GENERIC_CLOCKEVENTS
+ select HAVE_CACHE_SPLIT
++ select COLDFIRE_SW_A7
+ help
+ Freescale Coldfire 5207/5208 processor support.
+
diff --git a/board/qemu/m68k-mcf5208evb/linux-3.3.config b/board/qemu/m68k-mcf5208evb/linux-3.3.config
new file mode 100644
index 0000000..c20fb6f
--- /dev/null
+++ b/board/qemu/m68k-mcf5208evb/linux-3.3.config
@@ -0,0 +1,71 @@
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="/home/thomas/projets/buildroot/output/images/rootfs.cpio"
+CONFIG_INITRAMFS_COMPRESSION_GZIP=y
+CONFIG_EXPERT=y
+# CONFIG_KALLSYMS is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_MMU is not set
+CONFIG_M520x=y
+CONFIG_CLOCK_SET=y
+CONFIG_CLOCK_FREQ=166666666
+CONFIG_M5208EVB=y
+# CONFIG_4KSTACKS is not set
+CONFIG_RAMBASE=0x40000000
+CONFIG_RAMSIZE=0x2000000
+CONFIG_VECTORBASE=0x40000000
+CONFIG_KERNELBASE=0x40020000
+CONFIG_BINFMT_FLAT=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_RAM=y
+CONFIG_MTD_UCLINUX=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_NETDEVICES=y
+CONFIG_FEC=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_UNIX98_PTYS is not set
+CONFIG_SERIAL_MCF=y
+CONFIG_SERIAL_MCF_BAUDRATE=115200
+CONFIG_SERIAL_MCF_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_EXT2_FS=y
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_SYSFS is not set
+CONFIG_ROMFS_FS=y
+CONFIG_ROMFS_BACKED_BY_MTD=y
+# CONFIG_NETWORK_FILESYSTEMS is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_POINTER=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_BOOTPARAM=y
+CONFIG_FULLDEBUG=y
diff --git a/board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch b/board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch
new file mode 100644
index 0000000..d0a779f
--- /dev/null
+++ b/board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch
@@ -0,0 +1,42 @@
+qemu: add support for interrupt masking/unmasking
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+diff --git a/hw/mcf_intc.c b/hw/mcf_intc.c
+index 0b498dd..3c8f54b 100644
+--- a/hw/mcf_intc.c
++++ b/hw/mcf_intc.c
+@@ -64,7 +64,11 @@ static uint64_t mcf_intc_read(void *opaque, target_phys_addr_t addr,
+ case 0x10:
+ return (uint32_t)(s->ifr >> 32);
+ case 0x14:
+- return (uint32_t)s->ifr;
++ return (uint32_t)s->ifr;
++ /* Reading from SIMR and CIMR return 0 */
++ case 0x1c:
++ case 0x1d:
++ return 0;
+ case 0xe0: /* SWIACK. */
+ return s->active_vector;
+ case 0xe1: case 0xe2: case 0xe3: case 0xe4:
+@@ -102,6 +106,20 @@ static void mcf_intc_write(void *opaque, target_phys_addr_t addr,
+ case 0x0c:
+ s->imr = (s->imr & 0xffffffff00000000ull) | (uint32_t)val;
+ break;
++ /* SIMR allows to easily mask interrupts */
++ case 0x1c:
++ if (val & 0x40)
++ s->imr = ~0ull;
++ else
++ s->imr |= (1 << (val & 0x3f));
++ break;
++ /* CIMR allows to easily unmask interrupts */
++ case 0x1d:
++ if (val & 0x40)
++ s->imr = 0ull;
++ else
++ s->imr &= ~(1 << (val & 0x3f));
++ break;
+ default:
+ hw_error("mcf_intc_write: Bad write offset %d\n", offset);
+ break;
diff --git a/board/qemu/m68k-mcf5208evb/readme.txt b/board/qemu/m68k-mcf5208evb/readme.txt
new file mode 100644
index 0000000..a110f80
--- /dev/null
+++ b/board/qemu/m68k-mcf5208evb/readme.txt
@@ -0,0 +1,14 @@
+Compile a Qemu with the
+board/qemu/m68k-mcf5208evb/qemu-mcfint-masking-support.patch patch
+applied, which fixes problems in the interrupt controller emulation.
+
+To start the emulation, run:
+
+ qemu-system-m68k -M mcf5208evb -kernel output/images/vmlinux -serial stdio
+
+The filesystem is included as an initramfs inside the kernel image.
+
+At the moment, the boot process hangs when the first userspace process
+exits, with the kernel believing that someone is attempting to kill
+init.
+
diff --git a/configs/qemu_m68k_mcf5208_evb_defconfig b/configs/qemu_m68k_mcf5208_evb_defconfig
new file mode 100644
index 0000000..c8cf0c1
--- /dev/null
+++ b/configs/qemu_m68k_mcf5208_evb_defconfig
@@ -0,0 +1,14 @@
+BR2_m68k=y
+BR2_m68k_5208=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
+# BR2_USE_MMU is not set
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.3"
+BR2_LINUX_KERNEL_PATCH="board/qemu/m68k-mcf5208evb/"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/m68k-mcf5208evb/linux-3.3.config"
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU
2012-04-10 16:10 ` [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU Thomas Petazzoni
@ 2012-04-10 17:28 ` Gustavo Zacarias
0 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2012-04-10 17:28 UTC (permalink / raw)
To: buildroot
On 2012-04-10 13:10, Thomas Petazzoni wrote:
> The early m68k had no MMU, later m68k had MMUs, but Coldfires don't
> have MMU.
>
> config BR2_USE_MMU
> - bool "Enable MMU support" if BR2_arm || BR2_armeb || BR2_mips ||
> BR2_mipsel || BR2_sh || BR2_xtensa
> + bool "Enable MMU support" if BR2_arm || BR2_armeb || BR2_mips ||
> BR2_mipsel || BR2_sh || BR2_xtensa || BR2_m68k
> default y if !BR2_bfin
> help
> If your target has a MMU, you should say Y here. If you
Maybe default y if !(BR2_bfin || BR2_m68k) ?
Since most people will target Coldfire rather than 68xxx.
A quick look says v4 and v5 have MMU though.
Regards.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench
2012-04-10 16:10 ` [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench Thomas Petazzoni
@ 2012-04-17 22:54 ` Arnout Vandecappelle
2012-04-18 8:25 ` Thomas Petazzoni
0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2012-04-17 22:54 UTC (permalink / raw)
To: buildroot
On Tuesday 10 April 2012 18:10:46 Thomas Petazzoni wrote:
> +TOOLCHAIN_EXTERNAL_SITE=???
Shouldn't that be
http://sourcery.mentor.com/sgpp/lite/coldfire/portal/package9494/public/m68k-uclinux/
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench
2012-04-17 22:54 ` Arnout Vandecappelle
@ 2012-04-18 8:25 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-04-18 8:25 UTC (permalink / raw)
To: buildroot
Le Wed, 18 Apr 2012 00:54:35 +0200,
Arnout Vandecappelle <arnout@mind.be> a ?crit :
> On Tuesday 10 April 2012 18:10:46 Thomas Petazzoni wrote:
> > +TOOLCHAIN_EXTERNAL_SITE=???
>
> Shouldn't that be
> http://sourcery.mentor.com/sgpp/lite/coldfire/portal/package9494/public/m68k-uclinux/
Yes, sorry. I implemented this during a week-end, and I had no Internet
connection at that time :)
I'll fix up and resend.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-04-18 8:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 16:10 [Buildroot] [RFC] Development around Coldfire Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 1/5] arch: re-enable m68k and add a few architecture variants Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 2/5] toolchain: add Coldfire external toolchain from Sourcery CodeBench Thomas Petazzoni
2012-04-17 22:54 ` Arnout Vandecappelle
2012-04-18 8:25 ` Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 3/5] toolchain: add m68k to the list of arch that can work without MMU Thomas Petazzoni
2012-04-10 17:28 ` Gustavo Zacarias
2012-04-10 16:10 ` [Buildroot] [PATCH 4/5] busybox: enable useful hush suboptions Thomas Petazzoni
2012-04-10 16:10 ` [Buildroot] [PATCH 5/5] board: add support for Coldfire MCF5208EVB board emulated by Qemu Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox