Skip to content

Commit

Permalink
FIXME: ATA experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
frno7 committed Jul 10, 2021
1 parent 8e90d12 commit f6ec831
Show file tree
Hide file tree
Showing 6 changed files with 576 additions and 10 deletions.
15 changes: 5 additions & 10 deletions arch/mips/configs/ps2_defconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/mips 5.4.14 Kernel Configuration
# Linux/mips 5.4.83 Kernel Configuration
#

#
# Compiler: mipsr5900el-unknown-linux-gnu-gcc (Gentoo 9.2.0-r3 p4) 9.2.0
# Compiler: mipsr5900el-unknown-linux-gnu-gcc (Gentoo 9.3.0-r2 p4) 9.3.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90200
CONFIG_GCC_VERSION=90300
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

Expand All @@ -23,7 +21,6 @@ CONFIG_BUILDTIME_EXTABLE_SORT=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_HEADER_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
Expand Down Expand Up @@ -129,7 +126,7 @@ CONFIG_IPC_NS=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../initramfs-ps2"
CONFIG_INITRAMFS_SOURCE="../initramfs/ps2"
CONFIG_INITRAMFS_ROOT_UID=1000
CONFIG_INITRAMFS_ROOT_GID=1000
# CONFIG_RD_GZIP is not set
Expand Down Expand Up @@ -681,8 +678,6 @@ CONFIG_ALLOW_DEV_COREDUMP=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=m
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_DMA_FENCE_TRACE is not set
# end of Generic Driver Options
Expand Down Expand Up @@ -870,6 +865,7 @@ CONFIG_ATA_BMDMA=y
# PIO-only SFF controllers
#
CONFIG_PATA_PLATFORM=m
CONFIG_PATA_PS2=m

#
# Generic fallback / legacy drivers
Expand Down Expand Up @@ -1724,7 +1720,6 @@ CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_TI_LMU_COMMON is not set

#
# LED Triggers
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/mach-ps2/iop.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define IOP_RAM_SIZE 0x200000

#define IOP_OHCI_BASE 0x1f801600
#define IOP_PATA_BASE 0x14000040

/**
* iop_addr_t - I/O processor (IOP) bus address
Expand Down
22 changes: 22 additions & 0 deletions arch/mips/ps2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ static struct platform_device ohci_device = {
.resource = ohci_resources,
};

static struct resource pata_resources[] = { /* FIXME: Subresource to IOP */
[0] = {
.name = "PATA",
.start = IOP_PATA_BASE,
.end = IOP_PATA_BASE + 0x1f,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_IOP_DEV9,
.end = IRQ_IOP_DEV9,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
};

static struct platform_device pata_device = {
.name = "pata-ps2",
.id = -1,
.num_resources = ARRAY_SIZE(pata_resources),
.resource = pata_resources,
};

static struct resource gs_resources[] = {
[0] = {
.name = "Graphics Synthesizer",
Expand Down Expand Up @@ -91,6 +112,7 @@ static struct platform_device rtc_device = {
static struct platform_device *ps2_platform_devices[] __initdata = {
&iop_device,
&ohci_device,
&pata_device,
&gs_device,
&gs_drm_device, /* FIXME */
&rtc_device,
Expand Down
8 changes: 8 additions & 0 deletions drivers/ata/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,14 @@ config PATA_PLATFORM

If unsure, say N.

config PATA_PS2
tristate "PlayStation 2 PATA support"
depends on SONY_PS2
help
This option enables support for PATA interface harddisks, found
on PlayStation 2 models SCPH 10000-500xx having an appropriate
network adapter accessory.

config PATA_OF_PLATFORM
tristate "OpenFirmware platform device PATA support"
depends on PATA_PLATFORM && OF
Expand Down
1 change: 1 addition & 0 deletions drivers/ata/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ obj-$(CONFIG_PATA_OPTI) += pata_opti.o
obj-$(CONFIG_PATA_PCMCIA) += pata_pcmcia.o
obj-$(CONFIG_PATA_PALMLD) += pata_palmld.o
obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o
obj-$(CONFIG_PATA_PS2) += pata_ps2.o
obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
obj-$(CONFIG_PATA_RB532) += pata_rb532_cf.o
obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o
Expand Down
Loading

0 comments on commit f6ec831

Please sign in to comment.