From: Ondrej Zary <linux@zary.sk>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>,
Sergey Shtylyov <s.shtylyov@omp.ru>, Jens Axboe <axboe@kernel.dk>,
Tim Waugh <tim@cyberelk.net>,
linux-block@vger.kernel.org, linux-parport@lists.infradead.org,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 30/32] pata_parport-bpck6: move defines and mode_map to bpck6.c
Date: Tue, 7 Mar 2023 23:46:25 +0100 [thread overview]
Message-ID: <20230307224627.28011-31-linux@zary.sk> (raw)
In-Reply-To: <20230307224627.28011-1-linux@zary.sk>
Move all register definitions and mode_map to bpck6.c
Signed-off-by: Ondrej Zary <linux@zary.sk>
---
drivers/ata/pata_parport/bpck6.c | 44 ++++++++++++++++++++++++
drivers/ata/pata_parport/ppc6lnx.c | 54 ------------------------------
2 files changed, 44 insertions(+), 54 deletions(-)
diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c
index f6d0916577b3..0ed6a97ab04f 100644
--- a/drivers/ata/pata_parport/bpck6.c
+++ b/drivers/ata/pata_parport/bpck6.c
@@ -19,6 +19,50 @@
#include "pata_parport.h"
#include "ppc6lnx.c"
+/* 60772 Commands */
+#define ACCESS_REG 0x00
+#define ACCESS_PORT 0x40
+
+#define ACCESS_READ 0x00
+#define ACCESS_WRITE 0x20
+
+/* 60772 Command Prefix */
+#define CMD_PREFIX_SET 0xe0 // Special command that modifies next command's operation
+#define CMD_PREFIX_RESET 0xc0 // Resets current cmd modifier reg bits
+ #define PREFIX_IO16 0x01 // perform 16-bit wide I/O
+ #define PREFIX_FASTWR 0x04 // enable PPC mode fast-write
+ #define PREFIX_BLK 0x08 // enable block transfer mode
+
+/* 60772 Registers */
+#define REG_STATUS 0x00 // status register
+ #define STATUS_IRQA 0x01 // Peripheral IRQA line
+ #define STATUS_EEPROM_DO 0x40 // Serial EEPROM data bit
+#define REG_VERSION 0x01 // PPC version register (read)
+#define REG_HWCFG 0x02 // Hardware Config register
+#define REG_RAMSIZE 0x03 // Size of RAM Buffer
+ #define RAMSIZE_128K 0x02
+#define REG_EEPROM 0x06 // EEPROM control register
+ #define EEPROM_SK 0x01 // eeprom SK bit
+ #define EEPROM_DI 0x02 // eeprom DI bit
+ #define EEPROM_CS 0x04 // eeprom CS bit
+ #define EEPROM_EN 0x08 // eeprom output enable
+#define REG_BLKSIZE 0x08 // Block transfer len (24 bit)
+
+/* flags */
+#define fifo_wait 0x10
+
+/* DONT CHANGE THESE LEST YOU BREAK EVERYTHING - BIT FIELD DEPENDENCIES */
+#define PPCMODE_UNI_SW 0
+#define PPCMODE_UNI_FW 1
+#define PPCMODE_BI_SW 2
+#define PPCMODE_BI_FW 3
+#define PPCMODE_EPP_BYTE 4
+#define PPCMODE_EPP_WORD 5
+#define PPCMODE_EPP_DWORD 6
+
+int mode_map[] = { PPCMODE_UNI_FW, PPCMODE_BI_FW, PPCMODE_EPP_BYTE,
+ PPCMODE_EPP_WORD, PPCMODE_EPP_DWORD };
+
static void bpck6_send_cmd(struct pi_adapter *pi, u8 cmd)
{
switch (mode_map[pi->mode]) {
diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c
index 9a763cbda130..e72b1842adda 100644
--- a/drivers/ata/pata_parport/ppc6lnx.c
+++ b/drivers/ata/pata_parport/ppc6lnx.c
@@ -15,57 +15,3 @@
//***************************************************************************
-// 60772 Commands
-
-#define ACCESS_REG 0x00
-#define ACCESS_PORT 0x40
-
-#define ACCESS_READ 0x00
-#define ACCESS_WRITE 0x20
-
-// 60772 Command Prefix
-
-#define CMD_PREFIX_SET 0xe0 // Special command that modifies the next command's operation
-#define CMD_PREFIX_RESET 0xc0 // Resets current cmd modifier reg bits
- #define PREFIX_IO16 0x01 // perform 16-bit wide I/O
- #define PREFIX_FASTWR 0x04 // enable PPC mode fast-write
- #define PREFIX_BLK 0x08 // enable block transfer mode
-
-// 60772 Registers
-
-#define REG_STATUS 0x00 // status register
- #define STATUS_IRQA 0x01 // Peripheral IRQA line
- #define STATUS_EEPROM_DO 0x40 // Serial EEPROM data bit
-#define REG_VERSION 0x01 // PPC version register (read)
-#define REG_HWCFG 0x02 // Hardware Config register
-#define REG_RAMSIZE 0x03 // Size of RAM Buffer
- #define RAMSIZE_128K 0x02
-#define REG_EEPROM 0x06 // EEPROM control register
- #define EEPROM_SK 0x01 // eeprom SK bit
- #define EEPROM_DI 0x02 // eeprom DI bit
- #define EEPROM_CS 0x04 // eeprom CS bit
- #define EEPROM_EN 0x08 // eeprom output enable
-#define REG_BLKSIZE 0x08 // Block transfer len (24 bit)
-
-//***************************************************************************
-
-// ppc_flags
-
-#define fifo_wait 0x10
-
-//***************************************************************************
-
-// DONT CHANGE THESE LEST YOU BREAK EVERYTHING - BIT FIELD DEPENDENCIES
-
-#define PPCMODE_UNI_SW 0
-#define PPCMODE_UNI_FW 1
-#define PPCMODE_BI_SW 2
-#define PPCMODE_BI_FW 3
-#define PPCMODE_EPP_BYTE 4
-#define PPCMODE_EPP_WORD 5
-#define PPCMODE_EPP_DWORD 6
-
-//***************************************************************************
-
-int mode_map[] = { PPCMODE_UNI_FW, PPCMODE_BI_FW, PPCMODE_EPP_BYTE,
- PPCMODE_EPP_WORD, PPCMODE_EPP_DWORD };
--
Ondrej Zary
next prev parent reply other threads:[~2023-03-07 22:49 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 22:45 [PATCH 00/32] pata_parport-bpck6: rework bpck6 protocol driver Ondrej Zary
2023-03-07 22:45 ` [PATCH 01/32] pata_parport-bpck6: remove useless defines Ondrej Zary
2023-03-08 10:28 ` Sergei Shtylyov
2023-03-07 22:45 ` [PATCH 02/32] pata_parport-bpck6: remove useless range check from read/write_regr Ondrej Zary
2023-03-08 18:03 ` Sergey Shtylyov
2023-03-07 22:45 ` [PATCH 03/32] pata_parport-bpck6: don't cast pi->pardev to struct pardevice * Ondrej Zary
2023-03-08 18:15 ` Sergey Shtylyov
2023-03-07 22:45 ` [PATCH 04/32] pata_parport-bpck6: pass around struct pi_adapter * Ondrej Zary
2023-03-08 20:33 ` Sergey Shtylyov
2023-03-09 20:58 ` Ondrej Zary
2023-03-10 10:19 ` Sergey Shtylyov
2023-03-08 20:34 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 05/32] pata_parport-bpck6: remove lpt_addr from struct ppc_storage Ondrej Zary
2023-03-11 15:43 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 06/32] pata_parport-bpck6: remove ppc_id " Ondrej Zary
2023-03-08 20:41 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 07/32] pata_parport-bpck6: remove org_* " Ondrej Zary
2023-03-08 20:43 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 08/32] pata_parport-bpck6: remove mode " Ondrej Zary
2023-03-11 17:07 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 09/32] pata_parport-bpck6: remove " Ondrej Zary
2023-03-11 19:30 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 10/32] pata_parport-bpck6: remove parallel port bit defines Ondrej Zary
2023-03-07 22:46 ` [PATCH 11/32] parport_pc: add 16-bit and 8-bit fast EPP transfer flags Ondrej Zary
2023-03-11 20:09 ` Sergey Shtylyov
2023-03-11 20:31 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 12/32] pata_parport-bpck6: use parport access functions instead of port I/O Ondrej Zary
2023-03-07 22:46 ` [PATCH 13/32] pata_parport-bpck6: use parport_frob_control and remove CUR_CTRL Ondrej Zary
2023-03-07 22:46 ` [PATCH 14/32] pata_parport-bpck6: remove PPC_FLAGS Ondrej Zary
2023-03-11 20:12 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 15/32] pata_parport-bpck6: remove ppc6_close Ondrej Zary
2023-03-07 22:46 ` [PATCH 16/32] pata_parport-bpck6: merge ppc6_rd_port into bpck6_read_regr Ondrej Zary
2023-03-07 22:46 ` [PATCH 17/32] pata_parport-bpck6: merge ppc6_wr_port into bpck6_write_regr Ondrej Zary
2023-03-07 22:46 ` [PATCH 18/32] pata_parport-bpck6: merge ppc6_rd_port16_blk into bpck6_read_block Ondrej Zary
2023-03-07 22:46 ` [PATCH 19/32] pata_parport-bpck6: merge ppc6_wr_port16_blk into bpck6_write_block Ondrej Zary
2023-03-07 22:46 ` [PATCH 20/32] pata_parport-bpck6: merge ppc6_rd_data_blk into bpck6_read_block Ondrej Zary
2023-03-07 22:46 ` [PATCH 21/32] pata_parport-bpck6: merge ppc6_wr_data_blk into bpck6_write_block Ondrej Zary
2023-03-07 22:46 ` [PATCH 22/32] pata_parport-bpck6: move ppc6_wait_for_fifo to bpck6.c and rename Ondrej Zary
2023-03-07 22:46 ` [PATCH 23/32] pata_parport-bpck6: move ppc6_wr_extout " Ondrej Zary
2023-03-07 22:46 ` [PATCH 24/32] pata_parport-bpck6: move ppc6_open " Ondrej Zary
2023-03-07 22:46 ` [PATCH 25/32] pata_parport-bpck6: merge ppc6_select into bpck6_open Ondrej Zary
2023-03-07 22:46 ` [PATCH 26/32] pata_parport-bpck6: move ppc6_deselect to bpck6.c and rename Ondrej Zary
2023-03-07 22:46 ` [PATCH 27/32] pata_parport-bpck6: move ppc6_send_cmd " Ondrej Zary
2023-03-07 22:46 ` [PATCH 28/32] pata_parport-bpck6: move ppc6_rd_data_byte " Ondrej Zary
2023-03-07 22:46 ` [PATCH 29/32] pata_parport-bpck6: move ppc6_wr_data_byte " Ondrej Zary
2023-03-07 22:46 ` Ondrej Zary [this message]
2023-03-07 22:46 ` [PATCH 31/32] pata_parport-bpck6: delete ppc6lnx.c Ondrej Zary
2023-03-11 20:15 ` Sergey Shtylyov
2023-03-07 22:46 ` [PATCH 32/32] pata_parport-bpck6: reduce indents in bpck6_open Ondrej Zary
2023-03-11 20:00 ` [PATCH 00/32] pata_parport-bpck6: rework bpck6 protocol driver Sergey Shtylyov
2023-03-18 18:55 ` Ondrej Zary
2023-03-19 20:02 ` Sergey Shtylyov
2023-03-22 12:10 ` Ondrej Zary
2023-03-22 22:34 ` Damien Le Moal
2023-03-26 9:08 ` Sudip Mukherjee
2023-03-23 3:36 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230307224627.28011-31-linux@zary.sk \
--to=linux@zary.sk \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@opensource.wdc.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=s.shtylyov@omp.ru \
--cc=sudipm.mukherjee@gmail.com \
--cc=tim@cyberelk.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).