Commit 44b1fbc0 authored by Finn Thain's avatar Finn Thain Committed by Jens Axboe
Browse files

m68k/q40: Replace q40ide driver with pata_falcon and falconide



This allows m68k q40 systems to switch from the deprecated IDE subsystem
to libata.

Enhance the byte-swapping falconide and pata_falcon platform drivers to
accept an irq resource, for use on q40. Atari ST-DMA IRQ arrangements seem
to co-exist with q40 IRQ arrangements without too much mess.

The new IO resources were added solely for the purpose of making
request_region() reservations identical to those made by q40ide: these
regions aren't used for actual IO.

Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Richard Zidlicky <rz@linux-m68k.org>
Reviewed-and-tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarFinn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/eefb7e9c2291e09fb4e065ce06bc105f05bb9e06.1623287706.git.fthain@linux-m68k.org


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent cabd10be
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -875,16 +875,8 @@ static const struct resource atari_scsi_tt_rsrc[] __initconst = {
#define FALCON_IDE_BASE	0xfff00000

static const struct resource atari_falconide_rsrc[] __initconst = {
	{
		.flags = IORESOURCE_MEM,
		.start = FALCON_IDE_BASE,
		.end   = FALCON_IDE_BASE + 0x39,
	},
	{
		.flags = IORESOURCE_IRQ,
		.start = IRQ_MFP_FSCSI,
		.end   = IRQ_MFP_FSCSI,
	},
	DEFINE_RES_MEM(FALCON_IDE_BASE, 0x38),
	DEFINE_RES_MEM(FALCON_IDE_BASE + 0x38, 2),
};

int __init atari_platform_init(void)
+0 −1
Original line number Diff line number Diff line
@@ -351,7 +351,6 @@ CONFIG_BLK_DEV_PLATFORM=y
CONFIG_BLK_DEV_GAYLE=y
CONFIG_BLK_DEV_BUDDHA=y
CONFIG_BLK_DEV_FALCON_IDE=y
CONFIG_BLK_DEV_Q40IDE=y
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
+1 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ CONFIG_DUMMY_IRQ=m
CONFIG_IDE=y
CONFIG_IDE_GD_ATAPI=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_Q40IDE=y
CONFIG_BLK_DEV_FALCON_IDE=y
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
+31 −6
Original line number Diff line number Diff line
@@ -286,14 +286,39 @@ static int q40_set_rtc_pll(struct rtc_pll_info *pll)
		return -EINVAL;
}

static __init int q40_add_kbd_device(void)
{
	struct platform_device *pdev;
#define PCIDE_BASE1	0x1f0
#define PCIDE_BASE2	0x170
#define PCIDE_CTL	0x206

static const struct resource q40_pata_rsrc_0[] __initconst = {
	DEFINE_RES_MEM(q40_isa_io_base + PCIDE_BASE1 * 4, 0x38),
	DEFINE_RES_MEM(q40_isa_io_base + (PCIDE_BASE1 + PCIDE_CTL) * 4, 2),
	DEFINE_RES_IO(PCIDE_BASE1, 8),
	DEFINE_RES_IO(PCIDE_BASE1 + PCIDE_CTL, 1),
	DEFINE_RES_IRQ(14),
};

static const struct resource q40_pata_rsrc_1[] __initconst = {
	DEFINE_RES_MEM(q40_isa_io_base + PCIDE_BASE2 * 4, 0x38),
	DEFINE_RES_MEM(q40_isa_io_base + (PCIDE_BASE2 + PCIDE_CTL) * 4, 2),
	DEFINE_RES_IO(PCIDE_BASE2, 8),
	DEFINE_RES_IO(PCIDE_BASE2 + PCIDE_CTL, 1),
	DEFINE_RES_IRQ(15),
};

static __init int q40_platform_init(void)
{
	if (!MACH_IS_Q40)
		return -ENODEV;

	pdev = platform_device_register_simple("q40kbd", -1, NULL, 0);
	return PTR_ERR_OR_ZERO(pdev);
	platform_device_register_simple("q40kbd", -1, NULL, 0);

	platform_device_register_simple("atari-falcon-ide", 0, q40_pata_rsrc_0,
					ARRAY_SIZE(q40_pata_rsrc_0));

	platform_device_register_simple("atari-falcon-ide", 1, q40_pata_rsrc_1,
					ARRAY_SIZE(q40_pata_rsrc_1));

	return 0;
}
arch_initcall(q40_add_kbd_device);
arch_initcall(q40_platform_init);
+3 −3
Original line number Diff line number Diff line
@@ -1015,11 +1015,11 @@ config PATA_CMD640_PCI
	  If unsure, say N.

config PATA_FALCON
	tristate "Atari Falcon PATA support"
	depends on M68K && ATARI
	tristate "Atari Falcon and Q40/Q60 PATA support"
	depends on M68K && (ATARI || Q40)
	help
	  This option enables support for the on-board IDE
	  interface on the Atari Falcon.
	  interface on the Atari Falcon and Q40/Q60.

	  If unsure, say N.

Loading