m68k/atari: Initial ARAnyM support
Subsystems (3)
Geert Uytterhoeven
maintainerPATCH v2 1/4 m68k/atari: Initial ARAnyM support
From: Petr Stehlik <[email protected]>
[michael, geert: Cleanups and updates]
---
v2: No changes
v1:
- Export native feature API,
- Remove bogus line from Kconfig help.
arch/m68k/Kconfig | 7 ++ arch/m68k/Makefile | 1 + arch/m68k/emu/Makefile | 5 ++ arch/m68k/emu/natfeat.c | 116 +++++++++++++++++++++++++++++++++++++++ arch/m68k/include/asm/natfeat.h | 22 +++++++ arch/m68k/kernel/setup.c | 5 ++ 6 files changed, 156 insertions(+), 0 deletions(-) create mode 100644 arch/m68k/emu/Makefile create mode 100644 arch/m68k/emu/natfeat.c create mode 100644 arch/m68k/include/asm/natfeat.h
arch/m68k/Kconfig +7 -0
@@ -240,6 +240,13 @@ config SUN3 If you don't want to compile a kernel exclusively for a Sun 3, say N. +config NATFEAT + bool "ARAnyM emulator support" + depends on ATARI + help + This option enables support for ARAnyM native features, such as + access to a disk image as /dev/hda. + comment "Processor type" config M68020
arch/m68k/Makefile +1 -0
@@ -76,6 +76,7 @@ core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/ core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/ core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/ core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/ +core-$(CONFIG_NATFEAT) += arch/m68k/emu/ core-$(CONFIG_M68040) += arch/m68k/fpsp040/ core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
arch/m68k/emu/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for Linux arch/m68k/emu source directory +# + +obj-y += natfeat.o
arch/m68k/emu/natfeat.c new file +116 -0
116 lines not on this page · raw message
arch/m68k/include/asm/natfeat.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* ARAnyM hardware support via Native Features (natfeats) +* +* Copyright (c) 2005 Petr Stehlik of ARAnyM dev team +* +* This software may be used and distributed according to the terms of +* the GNU General Public License (GPL), incorporated herein by reference. +*/ + +#ifndef _NATFEAT_H +#define _NATFEAT_H + +long nf_get_id (const char *feature_name); +long nf_call (long id, ...); + +void nf_init (void ); +void nf_shutdown (void ); + +void nfprint (const char *fmt, ...) + __attribute__ ((format (printf,1 ,2 ))); + +# endif /* _NATFEAT_H */
arch/m68k/kernel/setup.c +5 -0
@@ -42,6 +42,7 @@#ifdef CONFIG_SUN3X #include <asm/dvma.h> #endif +#include <asm/natfeat.h> #if !FPSTATESIZE || !NR_IRQS #warning No CPU/platform type selected, your kernel will not work!
@@ -324,6 +325,10 @@ void __init setup_arch(char **cmdline_p)panic ("No configuration setup" ); } +#ifdef CONFIG_NATFEAT +nf_init (); +#endif +paging_init ();#ifndef CONFIG_SUN3
Signature · 1 line
1.7.0.4
Geert Uytterhoeven
maintainerPATCH v2 2/4 m68k/atari: ARAnyM - Add support for block access
From: Roman Zippel <[email protected]>
[geert: Cleanups and updates]
---
v2: No changes
v1:
- Wrap natfeat calls
Add wrappers with proper prototypes for the natfeat calls in nfblock. This fixes the problem where sector_t was pushed on the stack as a 64-bit value if CONFIG_LBDAF=y, while all parameters of the nf_call() varargs function are 32-bit.
- Update for v2.6.31 block layer changes,
- nfblock needs <linux/slab.h>,
- Make needlessly global functions static,
- Make struct block_device_operations const,
- Use pr_*(),
- Propagate error code from register_blkdev().
arch/m68k/Kconfig | 8 ++ arch/m68k/emu/Makefile | 2 + arch/m68k/emu/nfblock.c | 195 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+), 0 deletions(-) create mode 100644 arch/m68k/emu/nfblock.c
arch/m68k/Kconfig +8 -0
@@ -247,6 +247,14 @@ config NATFEAT This option enables support for ARAnyM native features, such as access to a disk image as /dev/hda. +config NFBLOCK + tristate "NatFeat block device support" + depends on BLOCK && NATFEAT + help + Say Y to include support for the ARAnyM NatFeat block device + which allows direct access to the hard drives without using + the hardware emulation. + comment "Processor type" config M68020
arch/m68k/emu/Makefile +2 -0
@@ -3,3 +3,5 @@ # obj-y += natfeat.o + +obj-$(CONFIG_NFBLOCK) += nfblock.o
arch/m68k/emu/nfblock.c new file +195 -0
195 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Geert Uytterhoeven
maintainerPATCH v2 3/4 m68k/atari: ARAnyM - Add support for console access
In reply to Geert UytterhoevenFrom: Roman Zippel <[email protected]>
[geert: Cleanups and updates]
---
v2: No changes
v1:
- early_param() does not exist in the modular case,
- Break too long lines,
- Make needlessly global functions static,
- Use pr_*(),
- Extract nfputs(), to avoid code duplication in nfcon_write() and
nfcon_tty_write().
arch/m68k/Kconfig | 8 +++ arch/m68k/emu/Makefile | 1 + arch/m68k/emu/natfeat.c | 38 ----------- arch/m68k/emu/nfcon.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+), 38 deletions(-) create mode 100644 arch/m68k/emu/nfcon.c
arch/m68k/Kconfig +8 -0
@@ -255,6 +255,14 @@ config NFBLOCK which allows direct access to the hard drives without using the hardware emulation. +config NFCON + tristate "NatFeat console driver" + depends on NATFEAT + help + Say Y to include support for the ARAnyM NatFeat console driver + which allows the console output to be redirected to the stderr + output of ARAnyM. + comment "Processor type" config M68020
arch/m68k/emu/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-y += natfeat.o obj-$(CONFIG_NFBLOCK) += nfblock.o +obj-$(CONFIG_NFCON) += nfcon.o
arch/m68k/emu/natfeat.c +0 -38
@@ -35,24 +35,6 @@ asm("\n"EXPORT_SYMBOL_GPL (nf_get_id);EXPORT_SYMBOL_GPL (nf_call); -static int stderr_id; - -static void nf_write (struct console *co,const char *str,unsigned int count) -{ -char buf[68 ]; - - buf[64 ] =0 ; -while (count >64 ) { -memcpy (buf, str,64 ); -nf_call (stderr_id, buf); - str +=64 ; - count -=64 ; - } -memcpy (buf, str, count); - buf[count] =0 ; -nf_call (stderr_id, buf); -} -void nfprint (const char *fmt, ...) {static char buf[256 ];
@@ -65,26 +47,6 @@ void nfprint(const char *fmt, ...)va_end (ap); } -static struct console nf_console_driver = { - .name ="debug" , - .write = nf_write, - .flags =CON_PRINTBUFFER , - .index =-1 , -}; - -static int __init nf_debug_setup (char *arg) -{ -if (strcmp (arg,"emu" )) -return 0 ; - - stderr_id =nf_get_id ("NF_STDERR" ); -if (stderr_id) -register_console (&nf_console_driver); -return 0 ; -} - -early_param ("debug" , nf_debug_setup); -static void nf_poweroff (void ) {long id =nf_get_id ("NF_SHUTDOWN" );
arch/m68k/emu/nfcon.c new file +162 -0
162 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Geert Uytterhoeven
maintainerPATCH v2 4/4 m68k/atari: ARAnyM - Add support for network access
In reply to Geert UytterhoevenFrom: Milan Jurik <[email protected]>
[petr: Second author]
[michael, geert: Cleanups and updates]
---
v2:
- Review comments from David Miller:
- Remove "dev->trans_start = jiffies;",
- Set pr_fmt(),
- Use netdev_*() for logging.
- Review comments from Petr Stehlik:
- Update ARAnyM URL.
v1:
- Convert to net_device_ops,
- nfeth doesn't need obsolete <net/ieee80211.h>,
- Convert print_mac to %pM,
- Break too long lines,
- Make needlessly global functions static,
- Make version[] const,
- Use pr_*(),
- Use net_device_stats from struct net_device instead of our own,
- Propagate error code from request_irq(),
- Remove unused variable "handled".
arch/m68k/Kconfig | 8 ++ arch/m68k/emu/Makefile | 1 + arch/m68k/emu/nfeth.c | 270 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 279 insertions(+), 0 deletions(-) create mode 100644 arch/m68k/emu/nfeth.c
arch/m68k/Kconfig +8 -0
@@ -263,6 +263,14 @@ config NFCON which allows the console output to be redirected to the stderr output of ARAnyM. +config NFETH + tristate "NatFeat Ethernet support" + depends on NET_ETHERNET && NATFEAT + help + Say Y to include support for the ARAnyM NatFeat network device + which will emulate a regular ethernet device while presenting an + ethertap device to the host system. + comment "Processor type" config M68020
arch/m68k/emu/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-y += natfeat.o obj-$(CONFIG_NFBLOCK) += nfblock.o obj-$(CONFIG_NFCON) += nfcon.o +obj-$(CONFIG_NFETH) += nfeth.o
arch/m68k/emu/nfeth.c new file +270 -0
270 lines not on this page · raw message
Signature · 1 line
1.7.0.4