Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17be2d2b authored by Adrian McMenamin's avatar Adrian McMenamin Committed by Paul Mundt
Browse files

sh: Add maple bus support for the SEGA Dreamcast.



The Maple bus is SEGA's proprietary serial bus for peripherals
(keyboard, mouse, controller etc). The bus is capable of some
(limited) hotplugging and operates at up to 2 M/bits.

Drivers of one sort or another existed/exist for 2.4 and a rudimentary
port, which didn't support the 2.6 device driver model was also in
existence.

This driver - for the bus logic itself and for the keyboard (other
drivers will follow) are based on the code and concepts of those old
drivers but have lots of completely rewritten parts.

I have the maple bus code as a built in now as that seems the sane and
rational way to handle something like that - you either want the bus
or you don't.

Signed-off-by: default avatarAdrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent e87ab0c4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -666,6 +666,17 @@ config SUPERHYWAY
	tristate "SuperHyway Bus support"
	depends on CPU_SUBTYPE_SH4_202

config MAPLE
       bool "Maple Bus support"
       depends on SH_DREAMCAST
       help
         The Maple Bus is SEGA's serial communication bus for peripherals
         on the Dreamcast. Without this bus support you won't be able to
         get your Dreamcast keyboard etc to work, so most users
         probably want to say 'Y' here, unless you are only using the
         Dreamcast with a serial line terminal or a remote network
         connection.

config CF_ENABLER
	bool "Compact Flash Enabler support"
	depends on SOLUTION_ENGINE || SH_SH03
+2 −2
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@
#

obj-$(CONFIG_SUPERHYWAY)	+= superhyway/
obj-$(CONFIG_MAPLE)		+= maple/
+3 −0
Original line number Diff line number Diff line
# Makefile for Maple Bus

obj-$(CONFIG_MAPLE) := maple.o
+735 −0

File added.

Preview size limit exceeded, changes collapsed.

+37 −0
Original line number Diff line number Diff line
#ifndef __ASM_MAPLE_H
#define __ASM_MAPLE_H

#define MAPLE_PORTS 4
#define MAPLE_PNP_INTERVAL HZ
#define MAPLE_MAXPACKETS 8
#define MAPLE_DMA_ORDER 14
#define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER)
#define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \
			  MAPLE_DMA_ORDER - PAGE_SHIFT : 0)

/* Maple Bus registers */
#define MAPLE_BASE     0xa05f6c00
#define MAPLE_DMAADDR  (MAPLE_BASE+0x04)
#define MAPLE_TRIGTYPE (MAPLE_BASE+0x10)
#define MAPLE_ENABLE   (MAPLE_BASE+0x14)
#define MAPLE_STATE    (MAPLE_BASE+0x18)
#define MAPLE_SPEED    (MAPLE_BASE+0x80)
#define MAPLE_RESET    (MAPLE_BASE+0x8c)

#define MAPLE_MAGIC    0x6155404f
#define MAPLE_2MBPS    0
#define MAPLE_TIMEOUT(n) ((n)<<15)

/* Function codes */
#define MAPLE_FUNC_CONTROLLER 0x001
#define MAPLE_FUNC_MEMCARD    0x002
#define MAPLE_FUNC_LCD        0x004
#define MAPLE_FUNC_CLOCK      0x008
#define MAPLE_FUNC_MICROPHONE 0x010
#define MAPLE_FUNC_ARGUN      0x020
#define MAPLE_FUNC_KEYBOARD   0x040
#define MAPLE_FUNC_LIGHTGUN   0x080
#define MAPLE_FUNC_PURUPURU   0x100
#define MAPLE_FUNC_MOUSE      0x200

#endif /* __ASM_MAPLE_H */
Loading